필터 지우기
필터 지우기

How to plot multiple arrays in a 3d or surface plot?

조회 수: 2 (최근 30일)
Meva
Meva 2017년 3월 21일
댓글: Meva 2017년 3월 22일
Hi,
I plotted my array using the code:
x=[1*1001] vector from 0 to 1;
for nt=1:Nt
t=0.1+(nt-1)*dt;
...
u=some vector like [1*1001];
if abs(t-0.1)<10^(-8)
u1=u;
elseif abs(t-0.7)<10^(-8)
u2=u;
elseif abs(t-1.2)<10^(-8)
u3=u;
elseif abs(t-2.3)<10^(-8)
u4=u;
...
... % Here I have many conditions.
end
end
plot(x,u1)
hold on
plot(x,u2)
hold on
plot(x,u3)
... % I have many u** functions to plot!
However, I want to plot all these u** functions versus x and t.
x-axis should be x,
y axis should be t,
and z axis should be u**.
As you see, t conditions are specific. So my t axis should really associated with the correct t value. And u** should be associated with the correct t** value.

채택된 답변

KSSV
KSSV 2017년 3월 22일
use plot3(x,t,u) after using surf with hold on.
  댓글 수: 1
Meva
Meva 2017년 3월 22일
Hi KSSV,
I actually used surface and contour. But The graphic is so fine. I need to make grid coarser. I did actually. But it still looks so fine, nothing has changed.
Thanks.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Lighting, Transparency, and Shading에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by