www.gusucode.com > graphics 案例源码程序 matlab代码 > graphics/ParameterizedMeshPlotExample.m

    %% Parameterized Mesh Plot
% Plot the parameterized mesh
% 
% $$\matrix{x = r\cos(s)\sin(t) \cr y = r\sin(s)\sin(t) \cr z = r\cos(t)
% \cr {\rm where\quad} r = 2+\sin(7s+5t)}$$
% 
% for $0<s<2\pi$ and $0<t<\pi$. Make the mesh partially transparent
% using |alpha|.

r = @(s,t) 2 + sin(7.*s + 5.*t);
x = @(s,t) r(s,t).*cos(s).*sin(t);
y = @(s,t) r(s,t).*sin(s).*sin(t);
z = @(s,t) r(s,t).*cos(t);
fmesh(x,y,z,[0 2*pi 0 pi])
alpha(0.8)