simulink_root does not have a parameter named 'PaperType'
Mostrar comentarios más antiguos
My code is using the following to set the paper type for Simulink. Howerver, I am getting the following error: simulink_root does not have a parameter named 'PaperType'.
set_param(0,'PaperType','A4'); % Simulink
Note: A similar command is used on the line before to set the paper type for MATLAB and that one works (see below). Also the same code runs on R2011b but it fails on R2025b after conversion.
set(0,'DefaultFigurePaperType','a4'); % Matlab
5 comentarios
dpb
el 24 de Sept. de 2025
Don't have Simulink but AI engine says the root 'PaperProperty' wasn't removed, but it also says recommended practice is now to query the particular model and set it for it instead...
% Get the handle to the currently active Simulink figure
h = get_param(gcs, 'Handle');
% Set figure properties before exporting
set(h, 'PaperType', 'A4');
I'd suggest trying that and seeing what happens...it does seem strange wouldn't be in the root object, though.
See if that will get you by for the time being until somebody who actually knows something comes by.
Peman
el 25 de Sept. de 2025
Peman
el 25 de Sept. de 2025
Walter Roberson
el 26 de Sept. de 2025
By the way, for set_param(0,'PaperType','A4')
R2018a reported
Warning: Clearing the current default model template so that new models will inherit this property of the root block diagram. To restore the default
model template call Simulink.defaultModelTemplate('$restore') or restart MATLAB. For more information, see the documentation.
Peman
el 26 de Sept. de 2025
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Model, Block, and Port Callbacks en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!