User`s guide

Working with Scope Objects
start(tg);
% Star t things off by triggering scope 1.
scNum = 1;
sc(scNum).trigger;
% Use the two scopes as a double buffer to log the data.
while (1)
% Wa it until this scope has finished acquiring 500 samples
% or the model stops (scope i s interrupted).
while ~(strcmp(sc(scNum).Status, 'Finished') || ...
strcmp(sc(scNum).Status, 'Interrupted')), end
% St op buffering data when the model stops.
if s trcmp(tg.Status, 'stopped')
break
end
% Sa ve the data.
t( end + 1 : end + 500) = sc(scNum).Time;
data(end + 1 : end + 500, :) = sc(scNum).Data;
% Re start this scope.
start(sc(scNum));
% Sw itch to the next scope.
scNum=3-scNum;
end
% Remo ve the scopes we added.
remscope(tg,[1 2]);
% Plot the data.
plot(t,data); grid on; legend('Signal 0','Signal 1');
2-23