Info
This question is closed. Reopen it to edit or answer.
surface plot of a function
1 view (last 30 days)
Show older comments
[EDIT: 20110625 10:25 CDT - reformat - WDR]
ı have a function
F= -0.1003*X + 0.0080*Y + 0.28844*Z - 0.0898*X*Y + 0.0976*X*Z - 0.0044*Y*Z + 0.0725*X*Y*Z - 0.3107;
variable x 15;25 y 2.5;3.5 z 25;75
how can ı write command for surface plot?
I tried this one but ı can't
n=10;
x=linspace(15,25,n);
y=linspace(2.5,3.5,n);
z=linspace(25,75,n);
[X,Y,Z]=ndgrid(x,y,z);
F=(-0.3107 + (-0.1003*X.) + (0.0080*Y.) + (0.28844*Z.) + (-0.0898*X.*Y.) + (0.0976*X.*Z.) + (-0.0044*Y.*Z.) + (0.0725*X.*Y.*Z.));
isosurface(F,0)
lighting phong
caxis
axis equal
colormap('flag');
view([55 34]);
0 Comments
Answers (1)
Sean de Wolski
on 24 Jun 2011
You're using an isovalue of zero, that means everything above zero is true. The range of F is
>> [min(F(:)) max(F(:))]
106.34 668.61
so everything is supposed to be plotted and it isn't because the boundaries aren't plotted. Pick a suitable isovalue and you'll see a plot:
n=10;
x=linspace(15,25,n);
y=linspace(2.5,3.5,n);
z=linspace(25,75,n);
[X,Y,Z]=ndgrid(x,y,z);
F=(-0.3107 + (-0.1003*X) + (0.0080*Y) + (0.28844*Z) + (-0.0898*X.*Y) + (0.0976*X.*Z) + (-0.0044*Y.*Z) + (0.0725*X.*Y.*Z));
fv = isosurface(F,170); %isovalue = 170
patch(fv)
1 Comment
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!