Borrar filtros
Borrar filtros

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

1 visualización (últimos 30 días)
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"

Respuesta aceptada

per isakson
per isakson el 15 de Oct. de 2017
Editada: per isakson el 15 de Oct. de 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

Más respuestas (0)

Categorías

Más información sobre Multidimensional Arrays en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by