关于matlab最优化中fmincon函数
来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/05/06 11:33:49
关于matlab最优化中fmincon函数
主程序如下:
x0=[0.17352;-0.33959;3.2403;3.043;-0.046951;6.8701e-011];
A=[-1,0,0,0,0,0;0,-1,0,0,0,0;0,0,-1,0,0,0;0,0,0,-1,0,0;0,0,0,0,-1,0;0,0,0,0,0,-1];
b=zeros(6,1);
[x,fval]=fmincon(@myfun11,x0,A,b,[],[],[],[],@opt115)
辅助函数如下:
function [c,ceq]=opt115(x)
c(1)=-x(1);
c(2)=-x(2);
c(3)=-x(3);
c(4)=-x(4);
主函数就省去了
出现如下问题:
Error using ==> fmincon
FMINCON cannot continue because user supplied nonlinear constraint function
failed with the following error:
Output argument "ceq" (and maybe others) not assigned during call to "C:\Documents and Settings\Administrator\桌面\fmincon优化程序\opt115.m (opt115)".
Error in ==> main at 8
[x,fval]=fmincon(@myfun11,x0,A,b,[],[],[],[],@opt115)
希望朋友们帮忙给看下,
主程序如下:
x0=[0.17352;-0.33959;3.2403;3.043;-0.046951;6.8701e-011];
A=[-1,0,0,0,0,0;0,-1,0,0,0,0;0,0,-1,0,0,0;0,0,0,-1,0,0;0,0,0,0,-1,0;0,0,0,0,0,-1];
b=zeros(6,1);
[x,fval]=fmincon(@myfun11,x0,A,b,[],[],[],[],@opt115)
辅助函数如下:
function [c,ceq]=opt115(x)
c(1)=-x(1);
c(2)=-x(2);
c(3)=-x(3);
c(4)=-x(4);
主函数就省去了
出现如下问题:
Error using ==> fmincon
FMINCON cannot continue because user supplied nonlinear constraint function
failed with the following error:
Output argument "ceq" (and maybe others) not assigned during call to "C:\Documents and Settings\Administrator\桌面\fmincon优化程序\opt115.m (opt115)".
Error in ==> main at 8
[x,fval]=fmincon(@myfun11,x0,A,b,[],[],[],[],@opt115)
希望朋友们帮忙给看下,
nonlinear constraint function(非线性约束辅助函数)改成
function [c,ceq]=opt115(x)
c(1)=-x(1);
c(2)=-x(2);
c(3)=-x(3);
c(4)=-x(4);
cep=[];
function [c,ceq]=opt115(x)
c(1)=-x(1);
c(2)=-x(2);
c(3)=-x(3);
c(4)=-x(4);
cep=[];
关于matlab最优化中fmincon函数
一个关于matlab中fmincon函数优化的问题,困扰中
MATLAB中最优化函数fmincon的语法中含有初始估计值x0,请问x0的选择如何选
关于MATLAB的fmincon函数
matlab fmincon 非线性优化
matlab最优化函数fmincon中的初值x0如何选取?恳请指教!
关于matlab里fmincon函数的问题
matlab fmincon函数用法
MATLAB中的fmincon函数
一个简单的matlab问题,fmincon优化,
关于matlab里的fmincon函数找函数最小值问题.
MATLAB中fmincon函数用的什么算法