Brace indexing is not supported for variables of this type.

4 Ansichten (letzte 30 Tage)
Alexandra Philip
Alexandra Philip am 20 Jul. 2020
Beantwortet: Dinesh Yadav am 23 Jul. 2020
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?

Antworten (1)

Dinesh Yadav
Dinesh Yadav am 23 Jul. 2020
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};

Kategorien

Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by