Borrar filtros
Borrar filtros

Scope print to figure. Problem with resolution

11 visualizaciones (últimos 30 días)
Jae wook Oh
Jae wook Oh el 20 de Jul. de 2022
Respondida: Ayush Aniket el 28 de Sept. de 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?

Respuestas (1)

Ayush Aniket
Ayush Aniket el 28 de Sept. de 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.

Productos


Versión

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by