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 Center および File ExchangeSurface and Mesh Plots についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by