Info
Questa domanda è chiusa. Riaprila per modificarla o per rispondere.
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.
    4 visualizzazioni (ultimi 30 giorni)
  
       Mostra commenti meno recenti
    
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 Commenti
Risposte (2)
  Stephen23
      
      
 il 14 Ott 2018
        
      Modificato: Stephen23
      
      
 il 14 Ott 2018
  
      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 Commento
Questa domanda è chiusa.
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!