how to draw a temperature distribution on (x,y,z)?
2 views (last 30 days)
Show older comments
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 Comments
Answers (1)
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
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')
See Also
Categories
Find more on Discrete Data Plots in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!