繪製二元函數z=f(x,y)=(x^2-2*x)*exp(-x^2-y^2-x*y)的曲線及其三視圖和三維表面圖形

繪製二元函數z=f(x,y)=(x^2-2*x)*exp(-x^2-y^2-x*y)的曲線,並繪製其三視圖和三維表面圖形。ide

解:MATLAB命令:函數

 [x,y]=meshgrid(-3:0.1:3,-2:0.1:2);spa

>> z=(x.^2-2*x).*exp(-x.^2-y.^2-x.*y);blog

>> mesh(x,y,z)圖片

 subplot(2,2,1);surf(x,y,z);view(0,90);get

>> subplot(2,2,2);surf(x,y,z);view(90,0);it

>> subplot(2,2,3);surf(x,y,z);view(0,0);io

 subplot(2,2,4);surf(x,y,z);class

結果:grid

wKiom1byjc7Se_qzAAFNlskcfrM360.png

圖1

wKiom1byjdCR91baAAIrLM_Kvhk766.png

圖2

相關文章
相關標籤/搜索