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

30 次查看(过去 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?
thx.
  4 个评论

请先登录,再进行评论。

采纳的回答

Julian Laackmann
Julian Laackmann 2012-8-14
编辑:MathWorks Support Team 2018-11-9
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 个评论
Image Analyst
Image Analyst 2012-8-14
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 http://www.mathworks.com/matlabcentral/fileexchange/36904-matlab-script-for-digitizing-a-published-graph

请先登录,再进行评论。

更多回答(2 个)

uncung fgv
uncung fgv 2012-8-14

asma chaudhry
asma chaudhry 2018-9-11
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

类别

Help CenterFile Exchange 中查找有关 Line Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by