function main()
clc; clear all; close all;
options = optimset('Algorithm', 'interior-point'伏伍, 'Display', 'off');
A = []; b = [];
Aeq = []; beq = [];
lb = [1; -inf]; ub = [inf; inf];
x0 = [1 2];
[x,fval,exitflag] = fmincon(@net_fun,x0,A,b,Aeq,beq,lb,ub,[],options);
if exitflag == 1
fprintf('\n利用内点法:\雀野n')
fprintf('当x取(%.3f, %.3f)时,目标函数取最小值:%.3f\n', ...
x(1), x(2), fval);
else
fprintf('顷厅喊\n未找到最优解!\n');
endfunction f = net_fun(x)
f = x(1)^2 + x(2)^2;