Assignment has more non-singleton rhs dimensions than non-singleton subscripts

1 回表示 (過去 30 日間)
alireza amiri
alireza amiri 2017 年 10 月 15 日
編集済み: per isakson 2017 年 10 月 15 日
Hi i have problem with this error,please help me for this
A=zeros(4,8,9,8,2);
for l=1:4
for m=1:8
K=1:.25:3;
for kindex=1:9
for j=1:8
for n=[0, 1]
A(l, m, kindex, j, n+1)=[a11vec(l, m, kindex, j, n+1),a12vec(l, m, kindex, j, n+1),a13vec(l, m, kindex, j);a21vec(l, m, kindex, j, n+1),a22vec(l, m, kindex, j, n+1),a23vec(l, m, kindex, n+1);a31vec(l, m, kindex, j),a32vec(l, m, kindex, n+1),a33vec(l, m, kindex, j, n+1)];
end
end
end
end
end
end
A is the martrix(3*3) and i have a11,a12,a13,a21,a22,a23,a31,a32,a33 for l,m,k, and n Variables. but when run,matlab said: "Assignment has more non-singleton rhs dimensions than non-singleton subscripts"

採用された回答

per isakson
per isakson 2017 年 10 月 15 日
編集済み: per isakson 2017 年 10 月 15 日
The RHS is a scalar
K>> A( l, m, kindex, j, n+1 )
ans =
0
K>>
the LHS is a 3x3 matrix
K>> whos z
Name Size Bytes Class Attributes
z 3x3 72 double
where
a11vec = ones( 4, 8, 9, 8, 2 );
...
for n=[0, 1]
z = [ a11vec(l,m,kindex,j,n+1), a11vec(l,m,kindex,j,n+1), a11vec(l,m,kindex,j)
a11vec(l,m,kindex,j,n+1), a11vec(l,m,kindex,j,n+1), a11vec(l,m,kindex,n+1)
a11vec(l,m,kindex,j) , a11vec(l,m,kindex,n+1) , a11vec(l,m,kindex,j,n+1)
];
%
A( l, m, kindex, j, n+1 ) = z;
end

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeInterpolation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by