Info
此问题已关闭。 请重新打开它进行编辑或回答。
Hi, I am working on a project where I have to save 960 figures for future individual analysis. So I thought it best to save them in a 'cell' or 'struct' .mat file to load and plot when necessary. Please advice on how to re-plot from a .mat file.
1 次查看(过去 30 天)
显示 更早的评论
x = rand(1,1000);
y = rand(1,1000);
z = rand(1,1000);
h = scatter3(x,y,z);
S = struct('fi',h);--------------------%Saving 'h' in a Struct
O{1,1}=h;------------------------------%Saving 'h' in a Cell
save('Struct.mat', 'S')
save('Cell.mat', 'O')
%Now after clearing everything, I am able to load the saved .mat files.
%How do I plot these into a figure.
%% The following is what gets saved in the .mat file. >> O{1,1}
ans =
Scatter with properties:
Marker: 'o'
MarkerEdgeColor: 'flat'
MarkerFaceColor: 'none'
SizeData: 36
LineWidth: 0.5000
XData: [1x1000 double]
YData: [1x1000 double]
ZData: [1x1000 double]
CData: [1x3 double]
Show all properties
0 个评论
回答(2 个)
Stephen23
2018-10-14
编辑:Stephen23
2018-10-14
Your idea is good, but MATLAB has a specific file format for saving and loading figures: the .fig file. It makes saving and loading figures easy: just like this:
saveas('file.fig',gcf) % all versions
savefig(gcf,'file.fig') % R2013b+
fgh = openfig('file.fig');
When you load it with openfig the figure will displayed (unless you select the 'invisible' option).
Read more:
1 个评论
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!