Array indices must be positive integers or logical values
조회 수: 1 (최근 30일)
이전 댓글 표시
I'm trying to do the Bairstow method but the fuctions to get delta r and delta s mark me as an error
coeff= length(fx);
r=r0;
s=s0;
ErrR=100;
ErrS=100;
while ErrR>tol || ErrS>tol
fx=fx(coeff:-1:1);
b(coeff)= fx(coeff)
b(coeff-1)= fx(coeff-1)+r*b(coeff);
for rs=(coeff-2:-1:1)
b(rs)= fx(rs)+r*b(rs+1)+s*b(rs+2);
end
c(coeff)= b(coeff);
c(coeff-1)= b(coeff-1)+r*c(coeff);
for rs=(coeff-2:-1:2)
c(rs)= b(rs)+r*c(rs+1)+s*c(rs+2);
end
deltaR= (b(0)*c(3)-b(1)*c(2))/((c(2))^2-c(1)*c(3))
deltaS= (b(1)*c(1)-b(0)*c(2))/((c(2))^2-c(1)*c(3))
r= deltaR+r;
s= deltaS+s;
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Direct Search에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!