min1.m

来自「Mathematical Methods by Moor n Stiling.」· M 代码 · 共 21 行

M
21
字号
% make the contour plot for wftest
% Copyright 1999 by Todd K. Moon

x1 = [2:.1:5];
x2 = [-3:.1:2];
[X1,X2] = meshgrid(x1,x2);
J = 3*X1.*X1 + 2*X1.* X2 + 3*X2.*X2 - 20 *X1 + 4*X2;
clf
subplot(2,2,1);
[C,hC] = contour(x1,x2,J,10);
axis square
Cnew = round(C*100+.49)/100;
clabel(Cnew,hC);
xlabel('x_1');    ylabel('x_2');
hold on 
plot([2 5],[0 0],':')
plot(10/3,0,'x')
plot(4,-2,'o')
print -dps ../pictures/min1.ps
print -deps ../pictures/min1.eps

⌨️ 快捷键说明

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