fmincon objective function input
Ältere Kommentare anzeigen
Hi,
I want to minimize sum of squared variables in fmincon while get the number of variables from users. For example, if he entered i=3, minimize x(1)^2+x(2)^2+x(3)^2. if he entered i=n, minimize x(1)^2+x(2)^2+...x(n)^2. Actually, I don't have any problem to set lower and upper limits and initial condition matrix, but I don't know how to define this function which fmincon accepts.
Thanks
1 Kommentar
Matt J
am 25 Jan. 2018
If you have no nonlinear constraints, though, it would be better to use quadprog
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Solver Outputs and Iterative Display finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!