Aeq cannot be a function. Aeq is for static equality constraints. You need to move those equality constraints over to the second output of a nonlinear constraint function, which you would pass after the options.
However, taking another look at your cons.m those are really static equality constraints that you can write in matrix form. You have
Ceq1 = 176 - 197*x(2) - 186*x(1)
Ceq2 = 906*x(2) - (687*x(1)) + 9.2485e+003
Aeq = @con
beq = [10000, 0];
that should be replaced with
Aeq = [-186, -197;
-687, 906];
Beq = [10000-176;
0-9.2485e+003];
Also, note that you used @con but supplied cons.m that has function con inside. However, MATLAB identifies functions by their file name when there is a conflict between the file name and the function name, so if you are going to use cons.m then you need to use @cons rather than @con . With the change I indicate here you should not need the function at all (or of a nonlinear constraint function), but you should take note of this for the future
Best Answer