. , , . .
plot3, . 2.5.1 . plot() - plot3() comet() - comet3(). comet3() , comet. () line() plot(), .. line(x,y,z).
z(x, ). (" ") . X Y , . meshgrid(). .
meshgrid() :
[X,Y] = meshgrid(x) [X,Y] = meshgrid(x,y);
[X,Y,Z] = meshgrid(x,y,z)
, ;
[X.Y] = meshgrid(x.y)
, , X Y, . X X.
3.2-13 |
>> [X,Y]=meshgrid(0:3,-3:0); >> X = 0 1 2 3 0 1 2 3 0 1 2 3 0 1 2 3 >> Y = -3 -3 -3 -3 -2 -2 -2 -2 -1 -1 -1 -1 0 0 0 0 >> |
mesh(X,Y,Z) , X,Y,Z ;
plot3(X,Y,Z) , ( plot); urf(X,Y,Z) .
: ezmesh(), ezsurf(), ezplot3() . . .
3.2-14 -4 4.
3.2-14 |
>> ezsurf('sin((x^2+y^2)^(0.5))/((x^2+y^2)^(0.5))',[-10 10],[-10 10]) >> |
. 3.2-16
, , ( ). . eps .
, , , ( help).
mesh(). mesh(z) , z. Z - X-Y . mesh(eye(10)). z=f(x,y) , xx yy, . meshgrid x, xx, yy, , , y, yy, [x,y] = meshgrid(xx,yy);. z, f , x y, mesh. , , [-2,2] [-2,2]
|
|
3.2-15 |
>> xx = -2:.1:2; >> yy = xx; >> [x,y] = meshgrid(xx,yy); >> mesh(z) >> |
[x,y] = meshgrid(-2:.1:2, -2:.1:2);.
(help plot3/mesh/surf).
. MatLab - , X-Y, , - .
contour(Z), Z - , , .. Zij = f(i, j). MatLab , . , contour(Z,n_of_lines), , contour(Z,values_of _levels). , , , , .
Z , Z(1,1) . X Y. , Z. :
3.2-16 |
>>contour(x,y,Z); contour(x,y,Z,n_of_lines); >>contour(x,y,Z,values_of_levels); >> |
z=z(x,y), : , , .
plot3(x,y,z) , plot(), ( x(i,:),y(i,:),z(i,:) . [x,y]=meshgrid(), .
3.2-17 | |
>> t=0:pi/50:10*pi; >> [x,y]=meshgrid([-2:0.1:2],[-2:0.01:2]); | |
>> plot3(sin(t),cos(t),t) >>z=exp(-x.^2-y.^2); >> plot3(x,y,z) | |
>> | |
.3.2-24 |
|
|
mesh(x,y,z,c), mesh(z,c), mesh(z) ( ; x,y , x=1:n, y=1:m, [m,n]=size(z).
3.2-18 |
>> [x,y]=meshgrid(-8:0.5:8); |
>> t=sqrt(x.^2+y.^2)+0.001; |
>> z=sin(t)./t; |
>> mesh(x,y,z) |
>> meshc(x,y,z) |
>> |
mesh() , meshz() ( ).
. 3.2-25 |
surf(x,y,z,c), surf(z,c), surf(z) , mesh() ; surf() .
, :
hiddenon/off ( on);
shadingfaceted / flat / interp ( faceted , flat - , interp - .
, Line() Surface(),
axec('< >',<>,...). :
axis([xminxmaxyminymax]),
axis([xminxmaxyminymaxzminzmax]), ;
axesoff/on () ;
gridon/off, grid () ;
boxon/off, box () , ;
zoomon/off () ( , - ; ;
zoomout .
mesh (...) surf(...) contour : contour(X,Y,Z) - Z =Z(X,Y), contour(X,Y,Z,n) - ( 10), contour(X,Y,Z,v) - ;contour(Z), contour(Z,n), contour(Z,v) - contour(...,LineSpec) - c (. plot); [C,h]=contour (...) , ( , .).
contourf(...) , contourf(...) [C,h, cf]=contour (...), cf .
3.2-26 3.2-27
>> [x,y]=meshgrid(-8:0.5:8); | >> [x,y]=meshgrid(-2:0.25:2); |
>> t=sqrt(x.^2+y.^2)+0.001; | >> t=sqrt(x.^2+y.^2)+0.001; |
>> z=sin(t).^3./t; | >> z=sin(t).^3./t; |
>> [c,h]=contour(x,y,z,20); >> | >> [c,h,cf]=contourf(x,y,z,4); >> |
. 3.2.26 | . 3.2.27 |
. 3.2.28 | contour3(...) contour(...), , ; [c,h]=contour3(x,y,z,20); (. 3.2.28). |