GRAFIK 3D MENGGUNAKAN MATLAB





GRAFIK 3D MENGGUNAKAN MATLAB



>> [x,y]=meshgrid(-5:.5:5,-4:.5:4);
>> z=x.*exp(-x.^2-y.^2);
>> mesh(x,y,z)
>> colormap hsv
>> title('\itf(x,y)=ex^{-x^2-y^2}')
>> xlabel('x')
>> ylabel('y')
>> zlabel('z')
>> surf(x,y,z)




>> surf(x,y,z)
>> r=sin(z)./cos(z);
>> surf(x,y,r)
>> r=tan(z)./sin(z);
>> surf(x,y,r)

>> r=tan(z)./csc(z);
>> surf(x,y,r)




>> x=[-3:0.5:3];
>> y=[-3:0.5:3];
>> [x,y]=meshgrid(x,y);
>> z=cos(x).*cos(y).*exp(-sqrt(x.^2+y.^2)/4);
>> surfc(x,y,z)
>> shading interp
>> colormap hot


>> x=[-1:0.5:1];
>>y=[-1:0.5:1];
>>[x,y]=meshgrid(linspace(0,10));
>>z=sin(x).*cos(y);
>>mesh(x,y,z)
>>title('Default colors for mesh')





Komentar

Postingan populer dari blog ini

PEMBAGIAN MATRIKS (ARRAY DIVISION)