MATLAB: Indexing a cell array column from multiple sources

char

Hi, I need to index a column of a 'results' table using different different sources.
The first row is empty (' '), the rows after that are the names from a filelist ('FileList.name'), this works fine.
However, the rows after that I'd like to assign elements from my string 'combinedToneNames'.
But I can't get this to work nicely: getting all 3 tone names (see snippet below) to show up below each other in new rows.
combinedToneNames = ['ClowD(-0dB)', 'EF(-0dB)', 'BChigh(-0dB)'];
results = {'', FileList.name, combinedToneNames}';
This gives the following result, I've clarified it a bit as well as added what I'd want it to be like:
combinedToneNames appears to be a 1×31 char, so I then tried splitting the string on whitespaces ( )
combinedToneNames = ['ClowD(-0dB)' 'EF(-0dB)' 'BChigh(-0dB)'];
splitCombToneNames = split(combinedToneNames);
results = {'', FileList.name, splitCombToneNames}';
This gave the exact same result as above.
I also tried looping through combinedToneNames:
combinedToneNames = ['ClowD(-0dB)', 'EF(-0dB)', 'BChigh(-0dB)'];
for kk = 1:length(combinedToneNames)
results = {'', FileList.name, combinedToneNames(kk)}';
end
This gave:
Anyone knows how to get information from a char to index different rows?

Best Answer

FileList.name = {'sjdjd.wav', 'sjdjf.wav'}; % example names
combinedToneNames = {'ClowD(-0dB)', 'EF(-0dB)', 'BChigh(-0dB)'};
results = [{[]}, FileList.name, combinedToneNames].'