How plot time varying animated 3D surface of z which depends on x and y as well as time, t such as: z (x, y, t) = exp -(x-5t)^2 + (y- 5t)^2.
10 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
z (x, y, t) = exp -(x-5t)^2 + (y- 5t)^2.
I need to plot z wrt independent variables x and y animating for time t= 0 to say, t= 10.
0 commentaires
Réponse acceptée
KSSV
le 28 Jan 2022
t = linspace(0,10) ;
x = linspace(0,1) ; % choose your range
y = linspace(0,1) ; % choose your range
[X,Y] = meshgrid(x,y) ;
for i = 1:length(t)
Z = exp(-(X-5*t(i))).^2 + (Y-5*t(i)).^2. ;
surf(X,Y,Z)
shading interp
drawnow
end
3 commentaires
KSSV
le 28 Jan 2022
What error you are getting? Show us your full code and error line. It is striaght forward to extend the given code to your case.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Animation dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
