matrix value in broyden's method

조회 수: 22 (최근 30일)
ZhenQi
ZhenQi 2013년 4월 18일
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일
jac(x) = jac(x) + (y - jac(x)*s)*s.'/(s(:).'*s(:));
or
jac(x) = jac(x) + (y - jac(x)*s)*s.'/norm(s).^2;

카테고리

Help CenterFile Exchange에서 Descriptive Statistics에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by