Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Extracting values from a plot 1

Status
Not open for further replies.

bordocf

New member
Sep 2, 2007
1
Hi all,

Is there a way to extract values from a plot. I have created a plot in MATLAB and would like to extract the y-value for any given x-value along the x-axis. I have x and y data stored as arrays from a for-loop. However, if I want to extract the y value for x=0.225 (first value along the x-axis) I need to impose y(1) instead of y(0.225). Any thoughts?
 
Replies continue below

Recommended for you

check out the fetch function... i haven't used it too much but that is probably what you're looking for
 
x = .2:.025:.3;
y = x.^2;

h = plot(x,y)

px = get(h,'XData');
py = get(h,'YData');

inx = find(x == .225)

py(inx)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor