Clear Filters
Clear Filters

How do I create a video from an animated plot?

38 views (last 30 days)
I want to create a video of the animated plot generated by this code:
close all
bb = importdata('data.txt');
xx = bb(:,1);
yy = bb(:,2);
xlabel('Time (Second)');
ylabel('Acceleration (Centimeter/Secon^2)');
curve = animatedline('Color', 'r');
grid off;
for i = 1:length(xx)
addpoints(curve,xx(i), yy(i));
drawnow limitrate
Any thoughts on how to do that?
Thank you.
  1 Comment
Image Analyst
Image Analyst on 18 Aug 2020
Not sure what your edit was (maybe you removed 'data.txt' attachment???), but the answers below should still work fine. Why don't you try and accept my Answer below?

Sign in to comment.

Accepted Answer

Image Analyst
Image Analyst on 13 Jun 2020
Here's a demo where I made a movie from a surf() plot where the plot changed at each frame.

More Answers (1)

KSSV on 11 Jun 2020


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!