Scope print to figure. Problem with resolution

6 ビュー (過去 30 日間)
Jae wook Oh
Jae wook Oh 2022 年 7 月 20 日
回答済み: Ayush Aniket 2023 年 9 月 28 日
Hi,
I'm trying to save the data plotted onto the scope of my simulink file and when I do so by clicking File tab > Print to Figure, the printed figure is low resolution like images shown below.
How can I fix this problem? How can I save the original resolution?

回答 (1 件)

Ayush Aniket
Ayush Aniket 2023 年 9 月 28 日
As per my understanding the issue you're experiencing is common when using the 'Print to Figure' feature in Simulink. For better resolution pictures, a workaround is to programmatically save the data from the scope and then plot it using MATLAB's plotting functions instead of using 'Print to Figure'.
These are the steps that you can follow:
  • Access the data from the Scope block: You can do this by setting the 'Data logging' parameter of the Scope block to 'on'. This will save the output to a workspace variable.
  • Plot the data using MATLAB's plotting functions: Once you have the data in the MATLAB workspace, you can use `plot` function to create a figure.
  • Save the figure in high resolution: You can use the 'print` function to save your figure. To save in high resolution, you can use the `-r` option in the `print` function to specify the resolution as shown below:
%saves the figure in 300 DPI.
print('figure1','-dpng','-r300')
You can read about saving data from scope block by referring to the following link:
Also, for more details on the various arguments in the 'print, function you can refer to the following link:
Hope this helps.

カテゴリ

Help Center および File ExchangeScopes and Data Logging についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by