Unable to perform assignment because brace indexing is not supported for variables of this type
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Here is the line of my script that I am struggling with
run{1,1} = Y1( 1 : R1(1) );
Where R1(1)=244, When I write like this : run{1,1} = Y1( 1 : 244 ) it is okay
but with R1(1) I get this error
Unable to perform assignment because brace indexing is not supported for variables of this type
2 commentaires
MarKf
le 1 Mar 2023
Usually I stumble on "variables of this type" error because variables are already present in the workspace and I do not clear/preallocate/initialize (for quick implementations/testing, sometimes switching and running back and forth between cells). If it's really just a scalar, R1 does not sound like it's the issue here, but variable run might be (also I'd suggest not to call it a common command, run1 already works better)
Réponses (1)
Askic V
le 1 Mar 2023
You need to provide more context.
For example, this is OK.
run = cell(10,1);
R = 244:300;
Y = 1:300;
run{1} = Y(1:R(1))
run{1,1} = R(1)
0 commentaires
Voir également
Catégories
En savoir plus sur Whos 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!