surface plot of a function
정보
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
이전 댓글 표시
[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
답변 (1개)
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
2011년 6월 29일
이 질문은 마감되었습니다.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!