Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: getting the data out of Matlab fig
Date: Tue, 21 Apr 2009 00:32:02 +0000 (UTC)
Organization: The MathWorks Inc
Lines: 27
Message-ID: <gsj462$af2$1@fred.mathworks.com>
References: <gsiuva$sv8$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1240273922 10722 172.30.248.38 (21 Apr 2009 00:32:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 21 Apr 2009 00:32:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 869871
Xref: news.mathworks.com comp.soft-sys.matlab:534221


"Mahdieh" <mahdieh.emrani@capitalhealth.ca> wrote in message <gsiuva$sv8$1@fred.mathworks.com>...
> I have saved 50 2D simple graphs as a Matlab .fig(s).
> Now I need to get the data out of the graphs, i.e. XY of the data points ...
> I just need to know how to get the data for one graph.
> 
> Any help is appreciated, 
> Thanks, 
> -Mahdieh

Take a look at the documentation on "Handle Graphics". The handle graphics hierarchy gives you an idea of what the parent-child relationships are in a figure.

http://www.mathworks.com/access/helpdesk/help/techdoc/creating_plots/f7-41259.html

By using handles, you can traverse down to the plot objects to extract out the data.

There are several ways to access that info. Here's an example, reading from "test.fig" which contains a line plot:

fH = openfig('test.fig');  % open figure and get handle to figure
lineH = findobj(fH, 'type', 'line');  % get handles of lines
xData = get(lineH, 'xdata');  % get x-data
yData = get(lineH, 'ydata');  % get y-data



Hope this helps.

jiro