- Open the Scope block and navigate to Settings.
- Go to the Logging tab.
- Enable Log data to workspace.
- Set the Variable Name to “simout” and the Save Format to Structure with time.
cannot save figure from simulink
6 ビュー (過去 30 日間)
古いコメントを表示
whenever i try to save a plot generated from the simulink it is saved as an emty handle. and i get the following error
i am using 2016a version.

Warning: While saving an object of class 'matlabshared.scopes.UnifiedScope':
Method 'saveobj' is not defined for class 'matlabshared.scopes.UnifiedScope' or is removed from MATLAB's search path.
> In matlab.graphics.internal.figfile.FigFile/write (line 32)
In savefig (line 84)
In saveasfig (line 6)
In saveas (line 140)
In filemenufcn>localSaveExportHelper (line 216)
In filemenufcn>localSaveExport (line 344)
In filemenufcn (line 56)
In filemenufcn>localSave (line 186)
In filemenufcn (line 54)
Warning: Simulink.BlockDiagram object could not be saved in a MAT-file. It will be saved as an empty handle instead.
> In matlab.graphics.internal.figfile.FigFile/write (line 32)
In savefig (line 84)
In saveasfig (line 6)
In saveas (line 140)
In filemenufcn>localSaveExportHelper (line 216)
In filemenufcn>localSaveExport (line 344)
In filemenufcn (line 56)
In filemenufcn>localSave (line 186)
In filemenufcn (line 54)
Warning: Figure is saved in C:\Users\praween\Desktop\untitled.fig. Saving graphics handle variables can cause the creation of
very large files. To save graphics figures, use savefig.
> In matlab.graphics.internal.figfile.FigFile/write (line 32)
In savefig (line 84)
In saveasfig (line 6)
In saveas (line 140)
In filemenufcn>localSaveExportHelper (line 216)
In filemenufcn>localSaveExport (line 344)
In filemenufcn (line 56)
In filemenufcn>localSave (line 186)
In filemenufcn (line 54)
0 件のコメント
回答 (1 件)
Vedant Shah
2025 年 3 月 12 日
To save a plot generated using the ‘Scope’ block in a Simulink model, certain properties of the Scope block must be modified. Follow these steps to adjust the necessary settings:
Once the simulation is complete, execute the following commands in the MATLAB command window to save the figure:
time = simout.time;
data = simout.signals.values;
plot(time, data);
saveas(gcf, 'myPlot.png');
For additional details, refer to the official MATLAB documentation using the following commands:
web(fullfile(docroot, '/simulink/slref/scope.html'))
web(fullfile(docroot, '/matlab/ref/saveas.html'))
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Creating, Deleting, and Querying Graphics Objects についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!