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

2 次查看(过去 30 天)

回答(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