Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Exporting(Saving) an animated plot
Replies: 4   Last Post: Jan 1, 2014 6:43 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Dila

Posts: 2
Registered: 12/26/13
Exporting(Saving) an animated plot
Posted: Dec 26, 2013 4:58 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hi,

I have a code which plots an animated graph of flowing waves.

And my wish is to save it as .gif or .avi, or just export it somehow to include in a presentation.

My code is added below.

Thanks for your consideration..
Dila.

clc
clear all
hold off

k = 2*pi*1;
w = k*343;
L = 2.2;
x = -3:0.001:3;

% Dipole: normalized variables
p = [exp(-j*k*abs(x)).*sign(x)];
u = exp(-j*k*abs(x));

t = 0;

figure
subplot(211)
hp = plot(x,real(p*exp(j*w*t)));
title('normalized p(x,t)')
set(hp,'EraseMode','xor');
grid
axis([-3 3 -1 1])
hold on
plot([0 0],[-1 1],'b--')
hold off

subplot(212)
hu = plot(x,real(u*exp(j*w*t)));
set(hu,'EraseMode','xor');
grid
axis([-3 3 -1 1])
title('normalized u(x,t)')
hold on
plot([0 0],[-1 1],'b--')
xlabel('CTRL-C to terminate')
hold off

while 1
t = t+0.0001;
set(hp,'YData',real(p*exp(j*w*t)));
set(hu,'YData',real(u*exp(j*w*t)));
pause(0.03)
drawnow
end






Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.