📄 ex10_1.m
字号:
% EX10_1.M Plot a contour map and surface of the function% z=x^2y+x^2+2y^2clear % Clear variable and figuresclf x=[-2.0:.15:2.0]; % Define x,y pointsy=[-2.0:0.15:2.0];v=[0.5 1 2]; % Define level values[X,Y]=meshgrid(x,y); % Create matrix of pointsZ=Y.*(X.^2)+X.^2+2*(Y.^2);c=contour(x,y,Z,v);clabel(c) % Add height values to contourstitle('Contour Plot of z=x^2y+x^2+2y^2')pause% Plot a surface and meshfigure % Create a new figure windowsubplot(2,1,1),surf(X,Y,Z)xlabel('x')ylabel('y')subplot(2,1,2),plot3(X,Y,Z)title('Surface and Mesh Plots')xlabel('x')ylabel('y')%% Strike a key to see second plot after the pause
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -