How to optimise 2 variable with different dimension?
7 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponse acceptée
Walter Roberson
le 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);
Plus de réponses (1)
Voir également
Catégories
En savoir plus sur Get Started with Curve Fitting Toolbox dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!