105
cla(h1)
plot(h1, tau, x(tau), 'blue', 'linewidth', 2)
if k >= L
rectangle('parent', h1, 'position', ...
[k - L + 1 min(x(k - L + 1 : k)) L - 1 max(x(k - L + 1 : k)) - min(x(k -
L + 1 : k)) + 1e-9], ...
'linewidth', 2, 'edgecolor', [0 1 0])
end
set(h1, 'xlim', [min(tau) - 1e-8 max(tau) + 1e-8])
ab = get(h1, 'xlim');
if ~isempty(POS_OPEN)
disp(['S = ' num2str(S) '; POS_OPEN = ' num2str(POS_OPEN) '; x(k) =
' num2str(x(k))])
plot(h1, ab, POS_OPEN(2) * ones(size(ab)), 'color', [0 1 1])
end
cla(h2)
plot(h2, 1 : k, Q(1 : k), 'green', 'linewidth', 2)
plot(h1, ab, x(k) * ones(size(ab)), 'color', [1 0 0])
set(h0, 'numbertitle', 'off', 'name', ...
['tElapsed = ' num2str((now - t0) * 24)])
drawnow
pause(0.02)
end
Приложение 10