3D matrix surface plot animation

조회 수: 24 (최근 30일)
average.student
average.student 2021년 6월 9일
댓글: Star Strider 2021년 6월 9일
Hello!
I have a 3D matrix with multiple layers. I want to simulate these layers in an animated surface plot in a way that e.g. every second a new layer is shown. Is it possible to do that? If yes, how?

채택된 답변

Star Strider
Star Strider 2021년 6월 9일
Try this —
M = rand(10,10,5); % Create Test Matrix
figure
for k = 1:size(M,3)
surf(M(:,:,k))
axis([0 11 0 11 0 1])
drawnow
pause(1)
end
Thsi works correctly in R2021a.
  댓글 수: 2
average.student
average.student 2021년 6월 9일
It worked! Many thanks
Star Strider
Star Strider 2021년 6월 9일
As always, my pleasure!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

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