How can I solve this error 'Unable to perform assignment because brace indexing is not supported for variables of this type.'?

1 visualización (últimos 30 días)
Hi
this is my code
for i=1:448
g{i}=[0:1:447]';
end
for i=1:448
U{i}=inv(K)*g{i};
end
but it doesnot work for U and I recieved this error Unable to perform assignment because brace indexing is not supported for variables of this type.' can you help me with that?
  4 comentarios
the cyclist
the cyclist el 31 de Mayo de 2020
OK, so I made a good guess by making up a random 448*448 matrix. But the code above does not give an error.
There is something else causing the error. Maybe you defined U as something other than a cell array, earlier in the code?
talayeh tavangar
talayeh tavangar el 31 de Mayo de 2020
yeah I have defines U as an other variable thanks for your help. How I want to use only element of (1,1) of each matrix that produce. can you help me with that?

Iniciar sesión para comentar.

Respuestas (1)

madhan ravi
madhan ravi el 31 de Mayo de 2020
[U, g] = deal(cell(448,1)); % before loops

Categorías

Más información sobre Loops and Conditional Statements en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by