MATLAB: Extracting data series from *.fig file

data export from figure

Hi there,
I have a figure file, but not the original data.
Is there a way to extract the data array from the 2D plot, opened from *.fig file?
Thanks in advance,
Petr.

Best Answer

open data.fig %open your fig file, data is the name I gave to my file
D=get(gca,'Children'); %get the handle of the line object
XData=get(D,'XData'); %get the x data
YData=get(D,'YData'); %get the y data
Data=[XData' YData']; %join the x and y data on one array nx2
%Data=[XData;YData]; %join the x and y data on one array 2xn
Related Question