Brace indexing is not supported for variables of this type.

3 ビュー (過去 30 日間)
Alexandra Philip
Alexandra Philip 2020 年 7 月 20 日
回答済み: Dinesh Yadav 2020 年 7 月 23 日
I am attempting to extract the contents out of my double array so I would be able to see whether my input variable equals a value in column 1 of mergetables, then use that row to obtain the value in the second column of that row:
mergetables=[SERIAL_NUMBER,BIA_COF_0,BIA_COF_1,BIA_COF_2,BIA_COF_3...
,BIA_COF_4,SF_COF_0,SF_COF_1,SF_COF_2,SF_COF_3,SF_COF_4];
BIA0=mergetables{app.AccelSNEditField == mergetables{:,1},2}
Unfortunately, I obtain this error:
Brace indexing is not supported for variables of this type.
Any suggestions or resolutions to apply?

回答 (1 件)

Dinesh Yadav
Dinesh Yadav 2020 年 7 月 23 日
Split up your last line of code into two line.
indexes = app.AccelSNEditField == mergetables{:,1}
to get logical values for the indexes that you will be using to get the second column.
BIA0=mergetables{indexes,2};

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by