Determine the Y value from a given X from the generated figure?

Hi,
May I know how to determine the Y value from a given X from the generated figure? As I do not have any y equation.
attached is the matlab file.
Thanks a lot!

 Accepted Answer

If you have your two vectors x and y
y0=interp1(x,y,x0)

9 Comments

if true
figure
plot(delta(450,240:1000),'XData',[0:(D*1000)/760:(D*1000)]); %plot line 450
xlabel('Distance(mm)');
ylabel('Delta');
figure_FontSize=13;
set(get(gca,'XLabel'),'FontSize',figure_FontSize,'Vertical','top');
set(get(gca,'YLabel'),'FontSize',figure_FontSize,'Vertical','middle');
set(findobj('FontSize',10),'FontSize',figure_FontSize);
set(gca,'tickdir','in')
set(gca,'ticklength',[0.01 0.01]);
axis on
end
this is my code but lets say X = D*1000/2; %D=0.01 how do i obtain y and display in matlab?
I tried the code below but it gave me the wrong value
if true
x1 = D*1000/2;
idx = find(x1);
y1 = delta(idx);
display(y1);
end
Please, give an example we can test
attached is the file required. thanks for the help!
from line 55 onwards
how do i obtain the value of Y automatically in matlab from the generated figure based on the coding used in the attached folder.
%
%D=Desired Value
D=5
x=D/2
Please, give an example we can test. We are not able to read your image files.
ok. i uploaded the 5 files as below. thanks. have to run the file in order to obtain the Figure
This is your plot
figure
x=[0:(D*1000)/760:(D*1000)]
y=delta(80:840,620);
plot(x,y); %plot line y 620
If you want y0 corresponding to x0=D/2
x0=D/2
y0=interp1(x,y,x0)

Sign in to comment.

More Answers (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!