How to optimise 2 variable with different dimension?
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I have two motion data set. The first data set is x, the system state which contains all the joint angles of a 2D arm in different time frame and the last data set is u, 1d control input in different time frame. I have to do a motion optimisation where i have to find the optimised x and u by minimising a objective function. I have tried using matlab function like fminunc, fminsearch and lsqnonlin. However i have no idea how to set two different variables data set with different dimension as an initial guess for the optimisation function.
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 27 Nov. 2012
The initial guess should be a single vector which is the vector concatenation of all of the entries to be varied. The optimization function you pass should break the vector into appropriate pieces.
For example, if x0 is (say) 5 x 2, and u0 is (say) 7 x 1, then
initial_guess = [x0(:); u0(:)];
and the minimization function would accept a single parameter,
function output = myminfunc(P)
thisx = reshape(P(1:10), 5, 2);
thisu = P(11:17);
Weitere Antworten (1)
Siehe auch
Kategorien
Mehr zu Get Started with Curve Fitting Toolbox finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!