Filter löschen
Filter löschen

Scope print to figure. Problem with resolution

11 Ansichten (letzte 30 Tage)
Jae wook Oh
Jae wook Oh am 20 Jul. 2022
Beantwortet: Ayush Aniket am 28 Sep. 2023
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?

Antworten (1)

Ayush Aniket
Ayush Aniket am 28 Sep. 2023
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.

Produkte


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by