For a constrained nonlinear multivariable function f(x) subject to the constraints as follows: c(x)≤0; ceq(x)=0; A·x≤b; Aeq·x=beq; lb≤x≤ub The object function and nonlinear function can have other parameters besides x.And when call fmincon just use the function handle @ respectively,for example,x = fmincon(@(x)myfun(x,m,n),x0,A,b,Aeq,beq,lb,ub,@(a,b)mycon(a,b));
I want to learn if Aeq can also have other parameters such as p,q ,The name of the .m file is myAeq for example and call fmincon like this x = fmincon(myfun,x0,A,b,@(p,q)myAeq(p,q),beq,lb,ub,@mycon);

 채택된 답변

Walter Roberson
Walter Roberson 2011년 7월 18일

0 개 추천

No. fmincon() says that A, b, Aeq, and beq must be matrices. Function handles are not allowed for them. Only the objective function and the nonlinear constraint function can be function handles.

댓글 수: 2

Ashley
Ashley 2011년 7월 18일
Thanks for help!If so,how can the problem as I decribed be solved?Will the function fmincon uesful then?
Matt J
Matt J 2022년 9월 19일
Linear constraints are a special case of nonlinear constraints, so you can include Aeq*x=b in your nonlinear constraint function, where you can implement them any way you wish. However, you should probably elaborate on why you don't think they should be expressed in matrix form.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Quadratic Programming and Cone Programming에 대해 자세히 알아보기

태그

질문:

2011년 7월 18일

댓글:

2022년 9월 19일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by