⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main_fminconset.m

📁 调用FMINCONX编写的离散优化软件包
💻 M
字号:

% Test case for FMINCONSET
clear;
xlb=[10,17,0.2,17,10,13]';
xub=[20,130,0.8,30,15,20]';
set={[10 11 12 13 14 15 16 17 18 19 20],[],[0.2,0.25,0.3,0.4,0.5,0.6,0.8],[17 18 19 20 21 22 23 24 25 26 27 28 29 30],...
    [10 11 12 1314 15],[13 14 15 16 17 18 19 20]};
x0=[14 130 0.5 20 16 18]';
opt=optimset;
opt.TolX=1e-6; opt.TolCon=1e-6;%opt.Display='on';
[x_opt,f_opt,c,d]=fmincon('my_fun',x0,[],[],[],[],xlb,xub,'my_con',opt);
[x_opt1,f_opt1,c1,d1]=fminconset('my_fun',x0,[],[],[],[],xlb,xub,'my_con',opt,set,inf);
disp(['The optimum solution is :x_opt_T=[',num2str(x_opt'),']',',fmin=',num2str(f_opt'),'c,=',num2str(c)]);
disp(['The optimum solution is :x_opt1_T=[',num2str(x_opt1'),']',',fmin1=',num2str(f_opt1'),',c=',num2str(c1)]);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%2008.11.24%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
      
   
   
          


⌨️ 快捷键说明

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