问题
When I want to look at signals in the scope during a simulation, I might have to click on the Autoscale
button whenever the signal is out of view. Is there a way to automatically autoscale so you can always see the whole signal during the simulation?
[Simulink 8.3, Matlab R2014a]
回答1:
you can do that by writing a function to ask Simulink to automatically autoscale and call it every N seconds. The function I got are from here, it just basically triggers the autoscale button :
% 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')
来源:https://stackoverflow.com/questions/33437444/how-can-i-automatically-autoscale-the-plots-in-simulinks-scope-during-a-simulat