我使用cellfun
并将UniformOutput
设置为0.这会将指定的函数应用于每个单元格,并将输出作为单元格数组中的单元格返回。
这些单元格中的每一个都是具有1行和6列的单元阵列。例如,一个包含两个单元格的单元格数组:
ans =
{
[1,1] =
{
[1,1] = 1
[1,2] = 1
[1,3] = 1
[1,4] = 9
[1,5] = hello
[1,6] = 3
}
[2,1] =
{
[1,1] = 1
[1,2] = 1
[1,3] = 1
[1,4] = -33
[1,5] = world
[1,6] = 3
}
}
我想知道将其转换为2x6单元阵列的最有效方法,即:
ans =
{
[1,1] = 1
[1,2] = 1
[1,3] = 1
[1,4] = 9
[1,5] = hello
[1,6] = 3
[2,1] = 1
[2,2] = 1
[2,3] = 1
[2,4] = -33
[2,5] = world
[2,6] = 3
}