Info

This question is closed. Reopen it to edit or answer.

surface plot of a function

1 view (last 30 days)
huseyin
huseyin on 24 Jun 2011
Closed: MATLAB Answer Bot on 20 Aug 2021
[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]);

Answers (1)

Sean de Wolski
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
huseyin
huseyin on 29 Jun 2011
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!