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!