Hello everyone How could I get a video of the following animation?
1 view (last 30 days)
Show older comments
Hello everyone How could I get a video of the following animation? The code is presented below the input vectors.. Any suggestion would be appreciated. Greetings.
figure()
t0001= [ -2 -1.9 -1.8 -1.7 -1.6 -1.5 -1.4 -1.3 -1.2 -1.1 -1 -0.9 -0.8 -0.7 -0.6 -0.5 -0.4 -0.3 -0.2 -0.1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2 ];
nc0001_1 = [ -0.99767992 -0.88465003 -0.50773837 0.02062628 0.54283833 0.90312743 0.99402317 0.78841229 0.34762635 -0.19685286 -0.68261294 -0.96475679 -0.95912388 -0.66739444 -0.1765883 0.36689228 0.80093276 0.99606345 0.89407894 0.52540013 0 -0.52540013 -0.89407894 -0.99606345 -0.80093276 -0.36689228 0.1765883 0.66739444 0.95912388 0.96475679 0.68261294 0.19685286 -0.34762635 -0.78841229 -0.99402317 -0.90312743 -0.54283833 -0.02062628 0.50773837 0.88465003 0.99767992 ];
n=length(t0001);
i=1;
while i<n
p=plot(t0001(1:i),nc0001_1(1:i));
set(gca,'FontSize',FS)
xtickformat("%.1f")
ytickformat("%.3f")
xlabel("Time, t(s)");
ylabel("Elevation free surface, n(m)");
leg=legend("Free surface",'Location','north','Orientation','horizontal');
leg.ItemTokenSize = [x1, x2];
legend('boxoff');
i=i+1;
xlim([2, 10]);
ylim([-0.025, 0.025]);
pause(0.01);
end
1 Comment
Geoff Hayes
on 23 Sep 2022
@Juan David Parra Quintero - I don't see calls to plot or equivalent in the above code so it is unclear what is being animated? As for creating a video, you may want to check Create AVI File from Animation for example code for creating a video.
Answers (0)
See Also
Categories
Find more on Animation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!