Path: news.mathworks.com!newsfeed-00.mathworks.com!NNTP.WPI.EDU!elk.ncren.net!newsflash.concordia.ca!canopus.cc.umanitoba.ca!not-for-mail
From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Newsgroups: comp.soft-sys.matlab
Subject: Re: Exporting data from .fig to matlab
Date: Fri, 16 May 2008 20:04:32 +0000 (UTC)
Organization: National Research Council Canada - Conseil national de rechereches Canada
Lines: 29
Message-ID: <g0kpcg$f7l$1@canopus.cc.umanitoba.ca>
References: <7246882.1210904146653.JavaMail.jakarta@nitrogen.mathforum.org>
NNTP-Posting-Host: origin.ibd.nrc.ca
X-Trace: canopus.cc.umanitoba.ca 1210968272 15605 192.70.172.160 (16 May 2008 20:04:32 GMT)
X-Complaints-To: abuse@cc.umanitoba.ca
NNTP-Posting-Date: Fri, 16 May 2008 20:04:32 +0000 (UTC)
Originator: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Xref: news.mathworks.com comp.soft-sys.matlab:468930


In article <7246882.1210904146653.JavaMail.jakarta@nitrogen.mathforum.org>,
Suske  <susana.cruz2008@gmail.com> wrote:

>i have a figure .fig, from which i lost the data and i want to export
>the data into matlab, without needing to copy point by point. I tried
>from properties, Xdata and Ydata, but for that i would have to copy
>point by point (and there are a loooot of them).
>Can someone help me? I believe there is an easier way....

It is not clear to me why you think you would have to copy point by
point?

alllines = findobj('Type',line');
nlines = length(alllines);
thepoints = cell(nlines,2);
for K = 1:nlines
  thepoints{K,1} = get(alllines(K),'XData');
  thepoints{K,2} = get(alllines(K),'YData');
end


What happens after this depends on the structure of your plot and
how much of that structure you want to preserve.

This code depends upon your plot being composed of lines, not surfaces
or patches or contours... you didn't say.
-- 
  "The beauties of conception are always superior to those of
   expression."                               -- Walter J. Phillips