我有一个包含数字和字符串内容混合的表:
M =
rep file condition corrAns
___ __________________ _________ _______
1 'stimuli/03C1.wav' 'C1' 2
1 'stimuli/03C4.wav' 'C4' 1
......................
我想将M转换为数组,以便能够使用xlswrite
将其保存为电子表格,这需要输入数组。
但是,命令table2array(M)
给出了错误
Cannot concatenate the table variables 'rep' and 'file', because their types are double and cell.
我尝试使用
将第一列和最后一列从double转换为cellM(:,1) = table2cell(M(:,1))
甚至
for i_row=1:row_N
M(i_row,1) = num2cell(M(i_row,1));
M(i_row,4) = num2cell(M(i_row,4));
end
,但是这些转换都导致相同的错误。有什么建议吗?