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

1 Ansicht (letzte 30 Tage)
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"

Akzeptierte Antwort

per isakson
per isakson am 15 Okt. 2017
Bearbeitet: per isakson am 15 Okt. 2017
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

Weitere Antworten (0)

Kategorien

Mehr zu Interpolation finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by