I am a tutor a few days ago and taught MATLAB to draw functional images. I thought it would be okay if I had been studying for four years, it took me two days to draw a few images. Although it was made at last, I still had some knowledge.

The image andProgramNote (hope you can advise)

I. Spiral

1. Static spiral

A =. * PI;

H = plot3 (A. * Cos (A), A. * sin (a), 2. * A, 'B', 'linewidth', 2 );

Axis ([-50, 50,-50, 50, 0,150]);

Grid on

Set (H, 'erasemode', 'none', 'markersize', 22 );

Xlabel ('x axis '); ylabel ('y axis'); zlabel ('z axis ');

Title ('static hello ');

2. dynamic spiral

T =. * PI;

I = 1;

H = plot3 (sin (T (I), cos (T (I), T (I), '*', 'erasemode', 'None ');

Grid on

Axis ([-2 2-2 2 0 35])

For I = 2: length (t)

Set (H, 'xdata', sin (T (I), 'ydata', cos (T (I), 'zdata', T (I ));

Drawnow

Pause (1, 0.01)

End

Title ('dynamic hello ');

(Figure omitted)

3. Cylindrical Spiral

T =. * PI;

X = R. * Cos (t );

Y = R. * sin (t );

Z = T;

Plot3 (X, Y, Z, 'h', 'linewidth', 2 );

Grid on

Axis ('square ')

Xlabel ('x axis '); ylabel ('y axis'); zlabel ('z axis ');

Title ('cylindrical hello ')

Ii. rotating parabolic

B =. * PI;

[X, y] = meshgrid );

Z = (X. ^ 2 + Y. ^ 2)./4;

Meshc (x, y, z );

Axis ('square ')

Xlabel ('x axis '); ylabel ('y axis'); zlabel ('z axis ');

Title ')

Or use ezsurfc directly ('(X. ^ 2 + Y. ^ 2)./4 ')

Iii. Elliptical cylindrical

Load clown

Ezsurf ('(2 * Cos (u)', '4 * sin (u) ', 'V', [* Pi, * Pi])

View (-) % view processing

Shading interp % light handling

Colormap (MAP) % Color Processing

Grid on % add grid lines

Axis equal % make the X and Y axes proportions consistent

Xlabel ('x axis '); ylabel ('y axis'); zlabel ('z axis '); % add axis description

Title ('elliptical cyline') % Add title

Iv. Elliptical parabolic

B =. * PI;

[X, y] = meshgrid );

Z = x. ^ 2./9 + Y. ^ 2./4;

Meshc (x, y, z );

Axis ('square ')

Xlabel ('x axis '); ylabel ('y axis'); zlabel ('z axis ');

Title ('elliptical chilid ')

Or use ezsurfc directly ('x. ^ 2./9 + Y. ^ 2./4 ')

V. Dual-leaf dual-Surface

Ezsurf ('8 * Tan (u) * Cos (v) ', '8. * Tan (u) * sin (v) ',' 2. * Sec (u) ', [-Pi. /2, 3 * pi. /2, 0, 2 * Pi])

Axis equal

Grid on

Axis Square

Xlabel ('x axis '); ylabel ('y axis'); zlabel ('z axis ');

Title ('dual-leaf bilinesurface ')

6. Hyperbolic Cylinder

Load clown

Ezsurf ('2 * Sec (u) ', '2 * Tan (u)', 'V', [-PI/2, PI/2,-3 * Pi, 3 * Pi])

Hold on % continue plotting on the original graph

Ezsurf ('2 * Sec (u) ', '2 * Tan (u)', 'V', [PI/2, 3 * PI/2,-3 * Pi, 3 * Pi])

Colormap (MAP)

Shading interp

View (-15, 30)

Axis equal

Grid on

Axis equal

Xlabel ('x axis '); ylabel ('y axis'); zlabel ('z axis ');

Title ('hyperbolic cyline ')

VII. Hyperbolic Parabolic (Saddle Surface)

[X, y] = meshgrid );

Z = x. ^ 2./8-y. ^ 2./6;

Meshc (x, y, z );

View (85, 20)

Axis ('square ')

Xlabel ('x axis '); ylabel ('y axis'); zlabel ('z axis ');

Title ('hyperbolic chilid ')

Or use ezsurfc directly ('x. ^ 2./8-y. ^ 2./6 ')

VIII. parabolic cylinder

[X, y] = meshgrid );

Z = Y. ^ 2./8;

H = mesh (z );

Rotate (H, [1 0 1], 180) % Rotation Processing

% Axis ([-,-,-]);

Axis ('square ')

Xlabel ('x axis '); ylabel ('y axis'); zlabel ('z axis ');

Title ('parabolic cyline ')

Or use ezsurfc directly ('Y. ^ 2./8 ')

9. Ring Surface

Ezmesh ('(5 + 2 * Cos (u) * Cos (v)', '(5 + 2 * Cos (u) * sin (v )', '2 * sin (u) ', [* Pi, * Pi])

Axis equal

Grid on

Xlabel ('x axis '); ylabel ('y axis'); zlabel ('z axis ');

Title ('Donut ')

10. Elliptical

Ezsurfc ('(5 * Cos (u) * sin (v)', '(3 * sin (u) * sin (v )', '4 * Cos (v) ', [* Pi, * Pi])

Axis equal

Grid on

Xlabel ('x axis '); ylabel ('y axis'); zlabel ('z axis ');

Title ('elliptical ')

11. Single-leaf dual-Surface

Ezsurf ('4 * Sec (u) * Cos (v) ', '2. * Sec (u) * sin (v) ',' 3. * Tan (u) ', [-Pi. /2, Pi. /2, 0, 2 * Pi])

Axis equal

Grid on

Xlabel ('x axis '); ylabel ('y axis'); zlabel ('z axis ');

Title ('single leaf biline ')

12. rotating a single-leaf dual-Surface

Load clown

Ezsurf ('8 * Sec (u) * Cos (v) ', '8. * Sec (u) * sin (v) ',' 2. * Tan (u) ', [-Pi. /2, Pi. /2, 0, 2 * Pi])

Colormap (MAP)

View (-175, 30)

% Alpha (. 2) % transparent processing

Axis equal

Grid on

Axis Square

Xlabel ('x axis '); ylabel ('y axis'); zlabel ('z axis ');

Title ('rotate a single-leaf bilinesurface ')

13. cylindrical surface

Subplot (1, 2)

Ezsurf ('(2 * Cos (u)', '2 * sin (u) ', 'V', [* Pi, * Pi])

Grid on

Shading interp

Axis equal

Xlabel ('x axis '); ylabel ('y axis'); zlabel ('z axis ');

Title ('cylindrical face ')

Subplot (1, 2)

Cylinder (30)

Shading interp

Axis Square

Title ('obtain the cylindrical surface by calling the cylinder function ')

The following example shows how to change the color of an image using colormap (): (the lighting effect "shading interp" is used ")

Colormap (); % hot/cool/Copper/gray/HSV/spring/summer/winter...

Colormap (HSV)

Colormap (hot)

Colormap (Gray)

Colormap (cool)

Colormap (copper)

The following operations are performed for rotation ("View ([])"), lighting ("shading interp"), and transparency ("alpha: