matrix value in broyden's method

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 件のコメント

ZhenQi
ZhenQi 2013 年 4 月 18 日
never mind I got it to work

サインインしてコメントする。

回答 (1 件)

Andrei Bobrov
Andrei Bobrov 2013 年 4 月 18 日
編集済み: Andrei Bobrov 2013 年 4 月 18 日

0 投票

jac(x) = jac(x) + (y - jac(x)*s)*s.'/(s(:).'*s(:));
or
jac(x) = jac(x) + (y - jac(x)*s)*s.'/norm(s).^2;

カテゴリ

ヘルプ センター および File ExchangeDescriptive Statistics についてさらに検索

タグ

質問済み:

2013 年 4 月 18 日

Community Treasure Hunt

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

Start Hunting!

Translated by