MATLAB Answers

navi g
0

How to find value of Y if i know X value from grap

Asked by navi g
on 9 Jan 2017
Latest activity Commented on by navi g
on 9 Jan 2017
Accepted Answer by KSSV
i search on matlab searching question but not found it. I have a graph with a curve. I want to know the Y value from my graph example X = 10 to 11, till 10 to 11 in y axis i have to mark. how to find Y?
i also seen some example like this, i can find for one x value one y value, but continues x data how to mark in cureve
%example having only one x data X = 1:0.1:20;
Y = sin(X);
index = find(X==10);
Y_point = Y(index)
% See graphically
plot(X,Y,X(index),Y_point,'o')
my question is now how to mark for x value 10 to 11

  0 Comments

Sign in to comment.

2 Answers

Answer by KSSV
on 9 Jan 2017
Edited by KSSV
on 9 Jan 2017
 Accepted Answer

clc; clear all ;
X = 1:0.1:20;
Y = sin(X);
index = find(X==10);
Y_point = Y(index)
% See graphically
plot(X,Y,X(index),Y_point,'o')
hold on
% plot X in the range 10 to 11
Xi = X(X>=10 & X<=11) ;
Yi = Y(X>=10 & X<=11) ;
plot(Xi,Yi,'*k')

  1 Comment

yeah thanku,, to increase number of marker in that range, means now i simulated yuor code, i got like this,
and i need like this more markers like this image
<<
>>

Sign in to comment.