Brace indexing is not supported for variables of this type.

2 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 Matrix Indexing 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by