I drew a mesh in Matlab. The data for the mesh was supplied with a filled 3d Matrix. Nothing special with that.
I saved the created figure and came back to it now. I want to create a different plot with the same data. Is there a way to extract the matrix data from the mesh so I can reuse it?
With some luck, following solution could work:
Load the figure file:
fig = openfig('fig_file_name.fig');
Get the surface data from the axes of the figure (assuming surface is the first "children"):
s = fig.CurrentAxes.Children(1);
Look for your data in s.XData
, s.YData
and s.ZData
.
Better solution is using findobj
(instead of fig.CurrentAxes.Children(1)
) use:
s = findobj(fig, 'type', 'Surface');