Grafico animado en matlab
Publicado por wil (26 intervenciones) el 30/06/2020 02:13:46
Hola, intente hacer un gráfico animado, pero no se como corregir mi error , desde ya agradezco.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
D=0.05;
M=20;
N=20;
m=M+1;
n=N;
alf=5;
bet=4;
figure(1)
T=1;% aqui regula o tempo da figura animada
dtt=0.0125;
tt=0;
while tt<T
tt=tt+dtt; % evolucion del tiempo
for itr=1:m-1
for i=1:n
uu(itr,i)=(2*D*bet*pi*sin(pi*x(itr))*exp(-D*pi*pi*t(i)))./(alf+bet*cos(pi*x(itr))*exp(-D*pi*pi*t(i)));
end
end
x=xl+(0:m-1)*h;t=tb+(0:n)*k;
surfc(x, t, uu'), colorbar; shg
caxis([-0.15 0.25]) % Pseudocolor axis scaling.
title([' Simulation results after t = ' num2str(tt) ' [s]'])
pause(dtt)
axis tight
end
xlabel('Width, [m] ')
ylabel('Length, [m] ')
zlabel('Displacement, [m]')
% %% Contour plot
figure(2)
contourf(x, t, uu'), colorbar; shg
title([' Simulation results after t = ' num2str(t) ' [s]'])
axis tight
xlabel('Width, [m] ')
ylabel('Length, [m] ')
Valora esta pregunta


0