simulink_root does not have a parameter named 'PaperType'
显示 更早的评论
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 个评论
dpb
2025-9-24
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
2025-9-25
Peman
2025-9-25
Walter Roberson
2025-9-26
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
2025-9-26
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Model, Block, and Port Callbacks 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!