Error calculation is not working

w1 = 0.4762;
w2 = -0.2152;
for k= 2: size(B)
B(k)= A(k)*w1+A(k-1)*w2;
end
disp(y);
for j= 2:size(B)
e(j)= B(j)-(A(j)*w1+A(j-1)*w2);
end
e(e==0)= [];
disp(e)
Ok this is the code, while k loop is running smoothly it doesn't seem so, to obtain any result at j loop for e that holds for error. A and B matrixes are perfectly loaded. What am I doing wrong??

2 件のコメント

KSSV
KSSV 2017 年 9 月 5 日
At the loop don't use size(B) ....either row or column dimensions which ever is required....YOu have not provided A and B....you didn't specify what is the error?
Floriane Madeleine Schreiber
Floriane Madeleine Schreiber 2017 年 9 月 5 日
maybe you have to use 'length(B)' instead of 'size(B)' !

回答 (0 件)

この質問は閉じられています。

質問済み:

2017 年 9 月 5 日

閉鎖済み:

2021 年 8 月 20 日

Community Treasure Hunt

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

Start Hunting!

Translated by