Index in position 2 exceeds array bounds (must not exceed 1) - need help with getting this to work. thanks

1 次查看(过去 30 天)
for i = 1:NA
for j= 1:NB
Bxx(i,j) = ( a11(i,j)*a22(i,j)) - ( a12(i,j)*a21(i,j)) / a11(i,j);
% Bxy(i,j) = [ a11(i,j)*a23(i,j) - a21(i,j)*a13(i,j)] / a11(i,j);
% Bxw(i,j) = [ all(i,j)*a24(i,j) - a21(i,j)*a14(i,j)] / all(i,j);
% Byx(i,j) = [ all(i,j)*a32(i,j) - a12(i,j)*a31(i,j)] / a11(i,j);
% Byy(i,j) = [ a11(i,j)*a33(i,j) - a13(i,j)*a31(i,j)] / a11(i,j);
% Byw(i,j) = [ a11(i,j)*a34(i,j) - a14(i,j)*a31(i,j)] / a11(i,j);
end
end
  6 个评论
Rik
Rik 2020-12-3
Your numbered variables make it look like you should be using arrays instead.
If you want NA to be 20, then you need to made sure all those a__ variables have at least 20 rows.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by