MATLAB Answers

How do I get object data from a FIG file, such as X and Y data?

조회 수: 207(최근 30일)
i search on matlab searching question but not found it.
I have a graph with a curve. I want to know the Y value from my graph
example X = 10
how to find Y?

  댓글 수: 4

표시 이전 댓글 수: 1
uncung fgv
uncung fgv 14 Aug 2012
not this what i man, i have no X, Y data. I only have hiperbolic curve in matlab graph/file.
GS76 10 Feb 2020
Thank you MRR!
Your reply helped me greatly.
Much appreciated.
afiq hassan
afiq hassan 25 Apr 2020
But what if I want to find x values using y axis?

댓글을 달려면 로그인하십시오.

채택된 답변

Julian Laackmann
Julian Laackmann 14 Aug 2012
편집: MathWorks Support Team 9 Nov 2018
Open the figure using “openfig” and return the “Figure” object as an output argument, such as "fig". Then use “fig” to access the underlying objects in the figure.
fig = openfig('MySavedPlot.fig')
For example, if the figure contains a line plot, you might want to get the X and Y data for the line. You can get the X and Y data using the XData and YData properties of the "Line" object. You can access the "Line" object through the "Children" property of the axes. You can access the "Axes" object through the “Children” property of the figure.
ax = fig.Children
ln = ax.Children;
X = ln.XData;
Y = ln.YData;

  댓글 수: 3

uncung fgv
uncung fgv 14 Aug 2012
my plot in matlab file. actually the curve is hyperbolic. X data is heigh
Y is velocity
so I want to find E=1/2 mv^2.
I have m data it is ok to find one by one Y data. by using Data Cursor. I want find many Y data from this plot.
uncung fgv
uncung fgv 14 Aug 2012
i mean how to get data from figure file.
Image Analyst
Image Analyst 14 Aug 2012
So all you have is a .fig file with the saved figure? You have absolutely no way to get the original data that was plotted to make the figure? There are submissions in the File Exchange to help you digitize values off a picture, such as

댓글을 달려면 로그인하십시오.

추가 답변(2개)

asma chaudhry
asma chaudhry 11 Sep 2018
Use Matlab's data cursor to find the first intersection of the line y=x with the graph of y=tan(x) in the first quadrant. Enter your answer as a decimal with 3 decimal places

  댓글 수: 0

댓글을 달려면 로그인하십시오.

Translated by