MATLAB: Error using fminimax at line 309

fminimaxMATLABoptimization

I'm trying to optimize a trajectory using the fminimax function. My objective to be minimized is the absolute value of a 3-dim thrust vector for a number of timesteps, t. The objective function is the euler-hill motion equations and thus is linear.
I have tried calling the objective as an anonymous function and within the anon. function computing each thrust vector in a loop for all the time steps, as well as decomposing the system of equations for each time step into one large matrix equation and solving all at once. With each method I get the same error:
>> ??? Error using ==> lt >> Matrix dimensions must agree.
>> Error in ==> fminimax at 309 >> lindex = xnew(i)<l(i);
My optimization variable is bounded, but I get the error with the bounds specified or not. This is not clear to me because as far as I can tell, bounds are not required, and the variable l(i) is an output of the checkbounds helper function and this logical check should not be used if there is no lower bound l…?
Details of the optimization setup:
f = 33×1 vector x = 99×1 vector C = 33×99 matrix Aeq = 78×99 matrix beq = 78×1 vector
options = optimset('MinAbsMax',33); [x f] = fminimax(@(x) objfun(x,C), [ ], [ ], [ ], Aeq, beq, [ ], [ ], [ ], options);
Any insight would be greatly appreciated!!

Best Answer

You seem to have accidentally set the initial guess argument, x0=[].