How can I make a movie of the plotted function due to time (for t=0:0.1:2)?
Ältere Kommentare anzeigen
Hello! I want to ask you how to make a movie of the plotted function due to time for t=0:0.1:2. In the code I wrote the formula of the differential equation (gif) after i wrote the formula of the coefficient (a). In the formula of gif i gave (x-v*t) instead of (x) in order to make it depending on the time (t). I plotted it of course, but just for a value of time. I'm stuck on how to make the plot for different time values between 0 and 2 with step width=0.1 as a movie. I hope that you can help me about that issue.
syms x;
a=zeros(110,1);
%stage 3
v=1; %m/s
gif=0;
t=0;
for i=1:1:110
a(i)=(2/50)*(int(x*sin((i*pi*x)/50),x,0,1)+int((2-x)*sin((i*pi*x)/50),x,1,2));
gif =gif + a(i)*sin((i*pi*(x-v*t)/50));
end
clear x
figure(1)
x=[-20 20];
plot=fplot(gif,x);
grid on
xlabel('space');
ylabel('phi(x)');
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Graphics finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!