How do I get object data from a FIG file, such as X and Y data?
169 ビュー (過去 30 日間)
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;