필터 지우기
필터 지우기

How do I plot animation of temperature data for a 3D object with time?

조회 수: 6 (최근 30일)
Swapnil Sinha
Swapnil Sinha 2020년 2월 19일
답변: darova 2020년 2월 20일
I have generated a 4D matrix (x,y,z,t) which stores the temperature value for the corresponding x,y,z coordinates at 't' timestep. This is as a result of transient heat transfer analysis. Is there a way I can animate the plot for temperature in 3D?
If not, can I show the animation of temperature with time for any chosen z?

답변 (1개)

darova
darova 2020년 2월 20일
Just use pause and for loop
maxt = max(t);
mint = min(t);
N = 100;
cmap = jet(N); % generate N colors for temperature
plot3(x,y,z)
hold on
for i = 1:length(x)
itemp = round((t(i)-mint)/(maxt-mint)*(N-1))+1;
h = plot3(x(i),y(i),z(i),'.','color',cmap(itemp,:));
pause(0.1)
delete(h)
end
hold off

카테고리

Help CenterFile Exchange에서 Animation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by