function approximation using any optimization routine
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
ARUN BORGOHAIN
le 21 Juin 2017
Modifié(e) : ARUN BORGOHAIN
le 23 Juin 2017
I've two linear equs: x1+x2=10 & x1-x2=2;
I would like to solve these using any optimization method for which these have to convert into a single function; In excel:i am doing this by excel solver by minimising sum sq deviation (initially assuming any values for x1 & x2); pl. help how to do it in matlab! Ex: I try to apply ga; but fail to make the needed fitness function!
0 commentaires
Réponse acceptée
Walter Roberson
le 21 Juin 2017
fun = @(x) (x(1)+x(2)-10).^2 + (x(1)-x(2)-2).^2
5 commentaires
Walter Roberson
le 22 Juin 2017
Yes, looks good. You might find you need @(x)A*x-b instead of @(x)A*x.'-b but one of the two should work.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Solver Outputs and Iterative Display 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!