MATLAB: Simulink scope autoscale

handlesMATLABscopesimulink

Hi everyone, i was wondering if there is a way for a scope i use in a simulink model to automaticaly autoscale. Maybe from adding a code to its startfunction???

Best Answer

Hi Raldi,
assuming the scope blocks are open, the following piece of code does the autoscaling for you:
% find all scope blocks as MATLAB figures:
set(0, 'showhiddenhandles', 'on')
scope = findobj(0, 'Tag', 'SIMULINK_SIMSCOPE_FIGURE');
for i=1:length(scope)
% this is the callback of the "autoscale" button:
simscope('ScopeBar', 'ActionIcon', 'Find', scope(i))
end
set(0, 'showhiddenhandles', 'off')
Titus