Make vectors X and Y from abscissas and ordinates of a given plot

Hello, they sent me a plot .fig, I opened it in MATLAB and I wonder if there is a way to make the abscissas and ordinates appear as vectors in the workspace, importing them in some way from the figure... Thanks a lot! Elena.

Respuestas (1)

Wayne King
Wayne King el 13 de Dic. de 2012
Editada: Wayne King el 13 de Dic. de 2012
Click "edit plot", then click on the data inside the plot, then enter
xdata = get(gco,'XData');
ydata = get(gco,'YData');
Another way is to load the figure file as a MAT file in the workspace.
Let's assume your .fig file is called testfig.fig and is on the MATLAB path
myFigStruct = load('testfig.fig','-MAT');
xdata = myFigStruct.hgS_070000.children.children.properties.XData;
ydata = myFigStruct.hgS_070000.children.children.properties.YData;

2 comentarios

Thanks so much!
I did not know about method two - super cool!

Iniciar sesión para comentar.

Categorías

Más información sobre Creating, Deleting, and Querying Graphics Objects en Centro de ayuda y File Exchange.

Preguntada:

el 13 de Dic. de 2012

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by