Determine the Y value from a given X from the generated figure?
You are now following this question
- You will see updates in your followed content feed.
- You may receive emails, depending on your communication preferences.
An Error Occurred
Unable to complete the action because of changes made to the page. Reload the page to see its updated state.
Show older comments
0 votes
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
Azzi Abdelmalek
on 27 Dec 2013
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
Azzi Abdelmalek
on 27 Dec 2013
Please, give an example we can test
Slarn
on 27 Dec 2013
attached is the file required. thanks for the help!
from line 55 onwards
Slarn
on 28 Dec 2013
anyone?
Azzi Abdelmalek
on 28 Dec 2013
Your question is not clear
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

Azzi Abdelmalek
on 28 Dec 2013
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
Azzi Abdelmalek
on 28 Dec 2013
Edited: Azzi Abdelmalek
on 28 Dec 2013
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)
More Answers (0)
Categories
Find more on Whos in Help Center and File Exchange
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)