/
concept-collection
/
sample-4
Jump to
/
Appearance
Match my system
Paper
GitHub
Slate
Midnight
Terminal
Sign in
concept-collection
/
sample-4
Code
Commits
Issues
0
Pull requests
0
Branches
1
Tags
0
main
Branches
main
sample-4
/
scripts
/
animation.m
12 lines · 350 B
Code
Blame
History
8a3780b
Initial commit
Jeremy Magland
1 month ago
1
% Live figure updates: drawnow flushes the figure mid-run.
2
% This one takes a
while
— try the stop button (⏹)
in
the tab bar.
3
x = linspace(
0
,
4
* pi,
400
);
4
figure;
5
for
k =
1
:
200
6
plot(x, sin(x - k /
4
) .* exp(-x /
8
));
7
axis([
0
4
*pi
-1
1
]);
8
title(sprintf(
'frame %d / 200'
, k));
9
drawnow;
10
pause(
0.04
);
11
end
12
disp(
'animation done'
);
↑
↓
move
↵
open
esc
close