simulink_root does not have a parameter named 'PaperType'
Afficher commentaires plus anciens
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 commentaires
dpb
le 24 Sep 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
le 25 Sep 2025
Peman
le 25 Sep 2025
Walter Roberson
le 26 Sep 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
le 26 Sep 2025
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Model, Block, and Port Callbacks dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!