www.gusucode.com > symbolic 源码程序 matlab案例代码 > symbolic/PlotParametricFunctionExample.m

    %% Plot Parameterized Surface
% Define the parametric surface |x(s,t), y(s,t), z(s,t)| as follows.

% Copyright 2015 The MathWorks, Inc.

syms s t
r = 2 + sin(7*s + 5*t);
x = r*cos(s)*sin(t);
y = r*sin(s)*sin(t);
z = r*cos(t);
%%
% Plot the function using |ezsurf|.
ezsurf(x, y, z, [0, 2*pi, 0, pi])
title('Parametric surface')
%%
% To create a smoother plot, increase the number of mesh points.
ezsurf(x, y, z, [0, 2*pi, 0, pi], 120)
title('Parametric surface with grid = 120')