Filter löschen
Filter löschen

Issue with finding the distance using improfile.

1 Ansicht (letzte 30 Tage)
Chathu
Chathu am 22 Dez. 2014
Beantwortet: Image Analyst am 22 Dez. 2014
I want to draw a line between two subplots (eg: subplot(1,2,1) and subplot(1,2,2)) based on their corresponding features. Afterwards, i want to find the euclidean distance between the subplots.
Here is the code that i have used:
openfig('pic1.fig')
[x, y, rgbLevels] = improfile();
line([x(1), x(end)], [y(1), y(end)]);
dist = sqrt((x(end)-x(1))^2 + (y(end)-y(1))^2)
My question is: improfile doesn't allow me to draw a line between two subplots. Instead it allows me to draw a line on one image only(which is not my intention). Can anyone tell me how to solve this issue? Thank you in advance.

Akzeptierte Antwort

Image Analyst
Image Analyst am 22 Dez. 2014
No it doesn't. improfile is not meant for that since it can't access pixels outside an image, like those on the GUI background. Maybe you can use ginput(2) instead.

Weitere Antworten (0)

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by