Execution of script fmincon as a function is not supported
Show older comments
Hello everyone, I'm trying to understand the basics of the fmincon function by implementing the example given on:
openExample('optim/LinearInequalityConstraintExample')
However, while trying to execute the aforementioned command, MatLab doesn't recognize the execution of this function.
fun = @(x) 100*(x(2)-x(1)^2)^2 + (1-x(1))^2;
x0 = [-1,2];
A = [1,2];
b = 1;
x = fmincon(fun,x0,A,b);
And the output reads as follows:
Execution of script fmincon as a function is not supported:
G:\My Drive\_COLLEGE_\4. U OF A\2022\2. FALL TERM\PET E 631\fmincon.m
Error in fmincon (line 7)
x = fmincon(fun,x0,A,b);
Note that I'm also using MATLAB R2022a.
Thanks for your help
Accepted Answer
More Answers (0)
Categories
Find more on Solver Outputs and Iterative Display 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!