how to draw a temperature distribution on (x,y,z)?

조회 수: 2 (최근 30일)
D
D 2013년 6월 9일

답변 (1개)

Iman Ansari
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
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')
D
D 2013년 6월 11일
편집: D 2013년 6월 11일
Thank you Iman.
I used function scatter3, like this: scatter3(x,y,z,[2000],t,'.'); grid off box off view(32,18); axis equal tight off vis3d; % azimuth 26 camproj perspective camlight; lighting gouraud; alpha(0.75); rotate3d on
And I got these:
https://lh4.googleusercontent.com/fd7y3UlG6ADff97F7tqSqRB9SASpNgnQ4xo2OhZj5Uc=w209-h207-p-no
https://lh6.googleusercontent.com/cby9SBv6Gx_GvZ9ycuaQBmgtXmCDlaRZzOf6UZU6Hj8=w112-h207-p-no
The problem is that the temperature points are big (big circles) which i want to smooth out between other circles. If I make the cricles smaller, the distances between these circles are even bigger, and the picture looses its appearance:
https://lh6.googleusercontent.com/ULZA8UR6CcJ30Ux9AtNwYx5c_nYonzMM4s_Y7pl34ak=w112-h207-p-no
How to overcome this? Can I maybe use interpolation, so that empty spaces between the circles could be filled out with average values?

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

카테고리

Help CenterFile Exchange에서 Discrete Data Plots에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by