plot3D a matrix and a vector

조회 수: 5 (최근 30일)
installdisc
installdisc 2016년 8월 13일
댓글: Star Strider 2016년 8월 13일
Hello!
i got time t 360001x1 double
I got a matrix Ygz 51*360001 double
in the matrix a got solutions in each timestep a 51 length column in the whole time rows 360001.
I want to plot the matrix so th solution ( so the 51 rows) in (360001) timestep.
How can I do this? I tried this
figure;
hold on
for ii = 1:10000:360001
plot(Ygz(:,ii))
end
The problem that this give a 2D plot with datavalues so I don't have time in it.....I want this in time but to do that I have to get a 3D plot with my 360001x1 and 51x360001 arrays. Please help.

채택된 답변

Star Strider
Star Strider 2016년 8월 13일
편집: Star Strider 2016년 8월 13일
Having your data would help.
This works:
t = linspace(0, 1, 360001)'; % Create Time Vector
Ygz = sin(([1:51]/5)'*[2*pi*t/3.60001]'); % Create Data
figure(1)
plot(t(1:10000:360001), Ygz(:, 1:10000:360001)')
grid
For a 3D plot, I would use the ribbon function:
t = linspace(0, 1, 360001)'; % Create Time Vector
Ygz = sin(([1:51]/5)'*[2*pi*t/3.60001]'); % Create Data
figure(1)
ribbon(t(1:10000:360001), Ygz(:, 1:10000:360001)')
grid on
view([50 30])
xlabel('Row #')
ylabel('Time')
  댓글 수: 2
installdisc
installdisc 2016년 8월 13일
Thank you very much. This could work.
Star Strider
Star Strider 2016년 8월 13일
My pleasure.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by