Unable to perform assignment because brace indexing is not supported for variables of this type
2 次查看(过去 30 天)
显示 更早的评论
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 个评论
MarKf
2023-3-1
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)
回答(1 个)
Askic V
2023-3-1
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 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Whos 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!