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

1 vue (au cours des 30 derniers jours)
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 commentaires
the cyclist
the cyclist le 31 Mai 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 le 31 Mai 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?

Connectez-vous pour commenter.

Réponses (1)

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

Catégories

En savoir plus sur Loops and Conditional Statements dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by