Skip to Main Content Skip to Search
Login
File Exchange
MATLAB Newsgroup
Link Exchange
  Blogs  
 Contest 
MathWorks.com

Thread Subject: Exporting data from .fig to matlab

Subject: Exporting data from .fig to matlab

From: Suske

Date: 16 May, 2008 02:15:16

Message: 1 of 3

Hi there:
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....

Tanks in advance!

Subject: Re: Exporting data from .fig to matlab

From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)

Date: 16 May, 2008 20:04:32

Message: 2 of 3

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

Subject: Re: Exporting data from .fig to matlab

From: aasim Azooz

Date: 17 May, 2008 07:50:03

Message: 3 of 3

Suske <susana.cruz2008@gmail.com> wrote in message
<7246882.1210904146653.JavaMail.jakarta@nitrogen.mathforum.o
rg>...
> Hi there:
> 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....
>
> Tanks in advance!
If you can be satisfied with approximate reproduction of
the data, you can try the program 'convert' you can
download it from the file exchange it may help
Aasim Azooz

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

envelope graphic E-mail this page to a colleague

Public Submission Policy
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.
Related Topics