更新时间:2023-02-06 17:35:08
最简单的解决方案是使用 num2cell
并将结果与字符串连接:
The simplest solution is to use num2cell
and concatenate the result with the strings:
y = [{'A1', 'B1'}; num2cell(f)];
>> f = reshape(1:10, 2, [])';
>> y = [{'A1', 'B1'}; num2cell(f)]
y =
'A1' 'B1'
[ 1] [ 2]
[ 3] [ 4]
[ 5] [ 6]
[ 7] [ 8]
[ 9] [10]