MATLAB: Fmincon too many input arguments

fmincontoo many input arguments

Hello all,
I've apparently a simpple question which is drving me crazy. Here it is. I'have the following functions
SSR = @(x)sum((y_ret - (x*var1 + x*var2 + x*var3))^2);
w_0 = rand(1,3)
Aeq = [1,1,1];
beq = 1;
[w] = fminsearch(SSR ,w_0,[],[],Aeq,beq);
I want to minimizse the SSR where var1 to 3 are vectors and get the "too many input arguements". Any idea why I get this? Thank you.
Eni

Best Answer

Because you're calling fminsearch, not fmincon.