how to draw a temperature distribution on (x,y,z)?
조회 수: 2 (최근 30일)
이전 댓글 표시
I have 3 coordinates x,y,z. For each x,y,z I have a corresponding temperature t. How can I draw it in matlab to get a "smooth" graph as in the below matlab example - graph (b)?
댓글 수: 0
답변 (1개)
Iman Ansari
2013년 6월 9일
t defines color:
[x y] = meshgrid(-10:0.1:10);
z =zeros(size(x));
z(x+2*y>-9 & 2*x+y<9 & x-y>-10 & x-y<15) = 1;
t = - x + y;
s=surf(x,y,z,t);
set(s,'EdgeColor','none')
댓글 수: 3
Iman Ansari
2013년 6월 11일
Here z is 3rd coordinate too, x,y and z define the shape and t defines its color:
[x y] = meshgrid(-10:0.1:10);
z = zeros(size(x));
z(x+2*y>-9 & 2*x+y<9 & x-y>-10 & x-y<15) = 1;
t = - x + y;
t(z==1) = 0;
s=surf(x,y,z,t);
set(s,'EdgeColor','none')
참고 항목
카테고리
Help Center 및 File Exchange에서 Discrete Data Plots에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!