minimum function(fmincon)
7 views (last 30 days)
Show older comments
Chongqing Fan
on 15 Jun 2016
Edited: Chongqing Fan
on 15 Jun 2016
Thank u so much for your attention for my question, the minimum is the value required, the "fmincon" matlab function is used, and the algorithm is default, but there is a problem not addressed, the following is the code:
function responsemum = numresponse(num) %%%%function 1
swith num
case 1
responsenum = @(x,y)x+y;
case 2
responsenum = @(x,y)x.*y; %%%%end of the function 1
function y = innerprod(fun1,fun2) %%%% function 2
y = @(x,y)fun1(x,y).*fun2(x,y); %%%end of function2
metag = innerprod(numresponse(1),numresponse(2));
TL = [-1,-1];
TU = [1,1];
T0 = [0,0];
[tmin,hlmin,exitflag] = fmincon(@(x,y)metag(x,y),T0,[],[],[],[],TL,TU);
there is some error message after run the code:
Error using@(x,y)metag(x,y) not enough input arguments
if u can give me any help, i will be appreciated, Thanks!
2 Comments
Accepted Answer
Walter Roberson
on 15 Jun 2016
[tmin,hlmin,exitflag] = fmincon(@(xy)metag(xy(1),xy(2)), T0, [], [], [], [], TL, TU);
More Answers (0)
See Also
Categories
Find more on GPU Computing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!