Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Exporting data from .fig to matlab

4 views
Skip to first unread message

Suske

unread,
May 15, 2008, 10:15:16 PM5/15/08
to
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!

Walter Roberson

unread,
May 16, 2008, 4:04:32 PM5/16/08
to
In article <7246882.12109041466...@nitrogen.mathforum.org>,
Suske <susana....@gmail.com> wrote:

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

aasim Azooz

unread,
May 17, 2008, 3:50:03 AM5/17/08
to
Suske <susana....@gmail.com> wrote in message
<7246882.12109041466...@nitrogen.mathforum.o
rg>...
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

Susana

unread,
Jul 24, 2012, 11:37:08 AM7/24/12
to
"aasim Azooz" <aasim...@yahoo.com> wrote in message <g0m2nb$obf$1...@fred.mathworks.com>...
Thanks for the tips
Susana

Susana

unread,
Jul 24, 2012, 11:39:21 AM7/24/12
to
Yes, they are lines, sorry i forgot to mention.
Susana
robe...@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote in message <g0kpcg$f7l$1...@canopus.cc.umanitoba.ca>...

fdgdfg

unread,
May 21, 2013, 10:40:09 PM5/21/13
to
"aasim Azooz" <aasim...@yahoo.com> wrote in message <g0m2nb$obf$1...@fred.mathworks.com>...

wen yang

unread,
Mar 18, 2016, 9:37:12 PM3/18/16
to
"aasim Azooz" <aasim...@yahoo.com> wrote in message <g0m2nb$obf$1...@fred.mathworks.com>...
0 new messages