MATLAB: How to store the column names for each numerical values for respective rows in an array

findindexingmatrix array

I'd like to get from a raw matrix like this:
several cell arrays of strings like this:
One = 'A' 'C' 'D' 'F'
Two = 'B' 'G'
How could I do this?

Best Answer

You can try something like this.
data=readtable('Name.xlsx','sheet','test')
Headers=data.Properties.VariableNames(2:end);
One=Headers(data{1,2:end}==1)
Two=Headers(data{2,2:end}==1)
%etc..
Related Question