Info

此问题已关闭。 请重新打开它进行编辑或回答。

surface plot of a function

1 次查看(过去 30 天)
huseyin
huseyin 2011-6-24
关闭: MATLAB Answer Bot 2021-8-20
[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]);

回答(1 个)

Sean de Wolski
Sean de Wolski 2011-6-24
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 个评论
huseyin
huseyin 2011-6-29
when ı applied your sugestion ı evoluated two dimentional graph ı can't surface plot. I find new function by using minitab program with central composite design. mY new function is that; F=(-0.500557) + (-0.259876*X) + (0.0475761*Y) + (0.0205674*Z) + (0.181748*X.*X) + (0.0237867*Y.*Y) + (0.0237867*Z.*Z) + (0.0684175*X.*Y) + (0.0248187*X.*Z) + (-0.161738*Y.*Z);
variable x 15;25 y 2.5;3.5 z 25;75 could you suggest any code for 3d surface plot ?

标签

Community Treasure Hunt

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

Start Hunting!

Translated by