本代码十分适合编程小白,大家直接复制黏贴就可以向大家喜欢的人表个白吧!
代码:
n=800;
p=pi;
[R,T]=ndgrid(linspace(0,1,n),linspace(-2,20*p,n));
x=1-(.5)*((5/4)*(1-mod(3.6*T,2*p)/p).^2-.25).^2;
U=2*exp(-T/(8*p));
L=sin(U);
J=cos(U);
y=1.99*(R.^2).*(1.2*R-1).^2.*L;
K=x.*(R.*L+y.*J);
X=K.*sin(T);
Y=K.*cos(T);
Z=x.*(R.*J-y.*L);
surf(X,Y,Z,'LineStyle','none')
grid,axis off;
colormap(jet)
效果:
!!!!!!!!!请大家给初入CSDN的小白点个赞吧!!!!!!!!
标签:ndgrid,代码,cos,15,大家,教你用,matlab,sin,linspace From: https://blog.csdn.net/2301_77953108/article/details/141791562