数学建模社区-数学中国

标题: Matlab有哪些炫酷的技巧? [打印本页]

作者: 洛桑曲旦    时间: 2015-7-28 15:50
标题: Matlab有哪些炫酷的技巧?
Matlab有哪些炫酷的技巧?

step = 0.05;
[X Y Z] = meshgrid(-3:step:3, -3:step:3, -3:step:3);
F=((-(X.^2).*(Z.^3)-(9/80).*(Y.^2).*(Z.^3))+((X.^2)+(9/4).*(Y.^2)+(Z.^2)-1).^3);
p = patch(isosurface(X,Y,Z,F,0));
set(p,'facecolor','w','EdgeColor','b');
daspect([1 1 1]), view(3), axis tight, axis equal

function RandDisplayjiong
axis off;
set(gcf,'menubar','none','toolbar','none');
for k=1:100
    h=text(rand,rand,['\fontsize{',num2str(unifrnd(20,50)),'}\fontname{隶书}囧'],'color',rand(1,3),'Rotation',360*rand);
pause(0.2);
end
% Surf of large breasts
% Reference: http://www.hirax.net/mobile/content/9883
%
% zhou lvwen

k = 12;

[x,y]=meshgrid(-3:0.03:3);

z = 1/8.*(k.*exp(-((2/3.*abs(x) - 1).^2 ...
    + (2/3.*y).^2) - 1/3*(2/3.*y + 1/2).^3) ...
    + 2/3.*exp(-2.818^11*((abs(2/3.*x) - 1).^2 ...
    + (2/3.*y).^2).^2) + 2/3.*y - (2/3.*x).^4);

I= find(sqrt((abs(x) - 3/2).^2 + y.^2) <0.45);
R = 1.0*ones(size(x)); &nbsp;R(I)=0.9;
G = 0.9*ones(size(x)); &nbsp;G(I)=0.6;
B = 0.9*ones(size(x)); &nbsp;B(I)=0.6;

h = surf(x,y,z,cat(3,R,G,B));

axis image
shading interp
camlight left;




欢迎光临 数学建模社区-数学中国 (http://www.madio.net/) Powered by Discuz! X2.5