democontour.m

来自「这是《Numerical Methods with MATLAB: Imple」· M 代码 · 共 8 行

M
8
字号
% demoContour  Demonstration of a contour plot

xg = linspace(-5,5,20);    %  grid vector
[X,Y] = meshgrid(xg,xg);   %  Create matrices of X and Y values
Z = 2 - X.^2 - Y.^2;       %  Vectorized evaluation of Z = f(X,Y)
contour(X,Y,Z)             %  Create the contour plot
axis('square')

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?