How to plot multidimensional array in one axes like sequence of images?

조회 수: 3 (최근 30일)
Pavel M
Pavel M 2023년 1월 9일
답변: Cameron 2023년 1월 9일
Hello! I want plot data like in this picture
So, I'm going to store data in multidimensional array like
data = [1 2 3 4 5; 5 6 7 8 9]; % example data
data(:,:,2) = [10 11 12 13 14; 15 16 17 18 19]; % example data
And then i want to plot this array in 3D on one figure. But matlab does not has any function to do it.
How it may be done?

채택된 답변

Cameron
Cameron 2023년 1월 9일
You can manually make some of these plots like this
t = 0:0.1:10;
z1 = sin(t);
z1(z1 < 0) = 0;
z2 = sin(t-1);
z2(z2 < 0) = 0;
z3 = sin(t-1.5);
z3(z3 < 0) = 0;
y1 = ones(1,length(t))*5;
y2 = ones(1,length(t))*10;
y3 = ones(1,length(t))*15;
fill3([t,t(end)],[y1,y1(1)],[z1,0],'r')
hold on
fill3([t,t(end)],[y2,y2(1)],[z2,0],'b')
fill3([t,t(end)],[y3,y3(1)],[z3,0],'y')
hold off

추가 답변 (0개)

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by