Error "Supplied objective function must return a scalar value."
5 views (last 30 days)
Show older comments
ANCY S GEORGE on 3 Jun 2022
Edited: ANCY S GEORGE on 30 Jan 2023
Hi,I am trying to minimize a function,but shows an error,
Error using fmincon (line 641)
Supplied objective function must return a scalar value.
Error in program23 (line 56)
[a,fv] = fmincon(f,X0,,,,,[3 3],[8 8])
Can someone explain me why? Please help me to correct this code.
Thanks in advance
Torsten on 3 Jun 2022
The function you pass to fmincon returns a vector of values, not a scalar.
Maybe you mean
or something similar.
More Answers (0)
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!