how i put this graphic in function of time ?

3 ビュー (過去 30 日間)
Ian Samuelsson
Ian Samuelsson 2019 年 6 月 12 日
編集済み: Guillaume 2019 年 6 月 12 日
clearvars;
% X=xv = Aceleração
% Y=yv = Massa
%Z = força
xv = linspace(0, 2 );
yv = linspace(0,2 );
[X, Y] = ndgrid(xv, yv );
Z = X.*Y;
surf(X, Y, Z, 'edgecolor', 'none ');
xlabel('Massa');
ylabel('Aceleração');
zlabel('z');
xv2 = linspace(0, 3 );
yv2 = linspace(0,3 );
[X, Y] = ndgrid(xv2, yv2 );
Z = sqrt((2.*X.*yv)./Y);
surf(X, Y, Z, 'edgecolor', 'none ');
xlabel('Gravidade');
ylabel('Raio');
zlabel('z');
HERE ARE a EXEMPLE , my teacher tell me to use it, but i can't use in my equation :
sol = pdepe(m,@pdefun,@icfun,@bcfun,xmesh,tspan);
[xmesh,tspan] = meshgrid(xmesh,tspan);
surf(xmesh,tspan/3600,sol);
xlabel('Raio R'); ylabel('Time t'); zlabel('Temperatura T(r,t)');
title('Temperatura em função do raio e do tempo')
view([105 5]);
figure; grid on; hold on;
xlabel('x'); ylabel('u(x,t)');
ylim([min(T0,Tinf),max(T0,Tinf)]);
v = VideoWriter('difusao.avi');
v.FrameRate = 20;
open(v);
nt = length(tspan);
for i=1:nt
plot(xmesh(1,:),sol(i,:),'LineWidth',2)
set(gca,'nextplot','replacechildren');
frame = getframe(gcf);
writeVideo(v,frame);
% pause(1);
end
l = num2str(tspan(:,1)/3600);
legend(l);
xlabel('Distance x'); ylabel('u(t,x)');
title('several times'); hold off; grid on;
close(v);

回答 (0 件)

カテゴリ

Help Center および File ExchangeString Parsing についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by