Constrained Optimization, a function that returns a vector?
Ältere Kommentare anzeigen
Hello! I looking for some matlab function (Constrained Optimization) which one returns a vector. The function what I try minimalize is in the attachment. It is MPC problem. I try to solve some problem like:
A = [];
b = [];
x0 = [0,0,0]
fun = @(x)(([3;3;3]-[3;3;3])'*([3;3;3]-[3;3;3])+parameter*(x-[1;1;1])'*(x-[1;1;1]))
[x,fval] = optimalization_function(fun,x0,A,b)
Matrices like [3;3;3] is just example.
I tried 'fmincon' but it works only for function that returns scalar.
Akzeptierte Antwort
Weitere Antworten (1)
jaskier222
am 14 Jul. 2017
2 Kommentare
Alan Weiss
am 14 Jul. 2017
Evaluate fun(x0). If you don't get a scalar, then your function is not scalar-valued. If you do get a scalar, then please ask again.
Alan Weiss
MATLAB mathematical toolbox documentation
Alan Weiss
am 16 Jul. 2017
I just had another idea. Try
x0 = zeros(3,1);
I think that your original x0 is a row vector, but should be a column vector.
Alan Weiss
MATLAB mathematical toolbox documentation
Kategorien
Mehr zu Get Started with Optimization Toolbox 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!