Unable to perform assignment because brace indexing is not supported for variables of this type
2 views (last 30 days)
Show older comments
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 Comments
MarKf
on 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)
Answers (1)
Askic V
on 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 Comments
See Also
Categories
Find more on Whos in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!