I am beginner of Matlab. While I use MATLAB to solve the problem of constrained nonlinear optimization, "Lack of input arguments" are always warning.Did someonecan tell me how to slove this probrem?THx
조회 수: 1 (최근 30일)
이전 댓글 표시
function f=optfun(x) f=-x(1)*x(2)*x(3); %fmincon_example.m X0=[1,1,1]; A=[1,2,2;0,1,0;0,0,1]; b=[72;5;10]; x=fmincon(optfun,X0,A,b) end
댓글 수: 1
답변 (1개)
Vishal Rane
2012년 12월 7일
function f=optfun(x)
f=-x(1)*x(2)*x(3); %fmincon_example.m
X0=[1,1,1];
A=[1,2,2;0,1,0;0,0,1];
b=[72;5;10];
x=fmincon(optfun,X0,A,b)
end
You are not providing the input x to optfun when passing it as an input to fmincon (last line) .
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Nonlinear Optimization에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!