Effacer les filtres
Effacer les filtres

matrix value in broyden's method

3 vues (au cours des 30 derniers jours)
ZhenQi
ZhenQi le 18 Avr 2013
Ok guys, for the iteration part of my broyden's method I have:
temp = x;
x = x - jac(x)\f(x);
s = x - temp;
y = f(x) - f(temp);
jac(x) = jac(x) + (y - jac(x)*s)*s'/(s*s);
now when I run this I get an error saying:
Error using * Inner matrix dimensions must agree. Error in broyden (line 32) jac(x) = jac(x) + (y - jac(x)*s)*s'/(s*s);
anyone know why this doesn't work?
  1 commentaire
ZhenQi
ZhenQi le 18 Avr 2013
never mind I got it to work

Connectez-vous pour commenter.

Réponses (1)

Andrei Bobrov
Andrei Bobrov le 18 Avr 2013
Modifié(e) : Andrei Bobrov le 18 Avr 2013
jac(x) = jac(x) + (y - jac(x)*s)*s.'/(s(:).'*s(:));
or
jac(x) = jac(x) + (y - jac(x)*s)*s.'/norm(s).^2;

Catégories

En savoir plus sur Operating on Diagonal Matrices dans Help Center et File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by