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

2 views (last 30 days)

Answers (1)

Iman Ansari
Iman Ansari on 9 Jun 2013
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 Comments
Iman Ansari
Iman Ansari on 11 Jun 2013
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 on 11 Jun 2013
Edited: D on 11 Jun 2013
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?

Sign in to comment.

Categories

Find more on Discrete Data Plots in Help Center and File Exchange

Tags

Products

Community Treasure Hunt

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

Start Hunting!