Path: news.mathworks.com!not-for-mail
From: "Mahdieh" <mahdieh.emrani@capitalhealth.ca>
Newsgroups: comp.soft-sys.matlab
Subject: Re: getting the data out of Matlab fig
Date: Thu, 23 Apr 2009 19:24:01 +0000 (UTC)
Organization: Glenrose Research Building
Lines: 33
Message-ID: <gsqf8h$8i3$1@fred.mathworks.com>
References: <gsiuva$sv8$1@fred.mathworks.com> <gsj462$af2$1@fred.mathworks.com>
Reply-To: "Mahdieh" <mahdieh.emrani@capitalhealth.ca>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1240514641 8771 172.30.248.37 (23 Apr 2009 19:24:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 23 Apr 2009 19:24:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1449772
Xref: news.mathworks.com comp.soft-sys.matlab:535054


awesome!
that's what i needed.
Thanks Jiro ...
:)

"Jiro Doke" <jiro.doke@mathworks.com> wrote in message <gsj462$af2$1@fred.mathworks.com>...
> "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