Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Lookup value on graph

Subject: Lookup value on graph

From: Wen Zhe

Date: 29 Jul, 2010 09:56:08

Message: 1 of 3

Hi guys (and girls),

I want to lookup a value on a graph i plotted. Let's say distance = 10 mm on the x axis ... how would i be able to find the corresponding value on the y axis from the graph? Note that i don't have any equation for the graph plotted. It is plotted using values data i imported onto Matlab.

Many thanks,

Wen Zhe

Subject: Lookup value on graph

From: us

Date: 29 Jul, 2010 11:57:08

Message: 2 of 3

"Wen Zhe " <wenzhe2092@hotmail.com> wrote in message <i2rj7o$pko$1@fred.mathworks.com>...
> Hi guys (and girls),
>
> I want to lookup a value on a graph i plotted. Let's say distance = 10 mm on the x axis ... how would i be able to find the corresponding value on the y axis from the graph? Note that i don't have any equation for the graph plotted. It is plotted using values data i imported onto Matlab.
>
> Many thanks,
>
> Wen Zhe

show CSSM your ML code...

us

Subject: Lookup value on graph

From: Walter Roberson

Date: 29 Jul, 2010 15:21:27

Message: 3 of 3

Wen Zhe wrote:

> I want to lookup a value on a graph i plotted. Let's say distance = 10
> mm on the x axis ... how would i be able to find the corresponding value
> on the y axis from the graph? Note that i don't have any equation for
> the graph plotted. It is plotted using values data i imported onto Matlab.

The biggest problem is converting 10 mm into data units. The below code
does not attempt that, as it is effectively impossible to do
programmatically.


xd = get(PlotHandle, 'XData');
yd = get(PlotHandle, 'YData');
y_at_P = interp1(xd, yd, P);

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us