surface plot of a function
Información
La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.
Mostrar comentarios más antiguos
[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]);
Respuestas (1)
Sean de Wolski
el 24 de Jun. de 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 comentario
huseyin
el 29 de Jun. de 2011
La pregunta está cerrada.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!