merge two cell in one single cell in matlab -


i have 2 cells. 1 of them is

cell 1= '1007_s_at' 780 'ddr1' '1053_at'   5982    'rfc2' '117_at'    3310    'hspa6' '121_at'    7849    'pax8' '1255_g_at' 2978    'guca1a' '1294_at'   7318    'uba7' '1316_at'   7067    'thra' 

and cell 2=

2x1 cell   2x1 cell   2x1 cell 2x1 cell   2x1 cell   2x1 cell 2x1 cell   2x1 cell   2x1 cell 2x1 cell   2x1 cell  2x1 cell 2x1 cell   2x1 cell  2x1 cell 

i used cat merge did not result want:

alldata= cat(1, cell 1, cell 2); '1007_s_at' 780 'ddr1'   '1053_at' 5982    'rfc2'   '117_at'  3310    'hspa6'   '121_at'  7849    'pax8'   '1255_g_at'   2978    'guca1a'    2x1 cell   2x1 cell   2x1 cell    2x1 cell   2x1 cell   2x1 cell    2x1 cell   2x1 cell   2x1 cell 

i want result display contents of cell 2 can see them in console, not nested cells.

what need change structure of cell2 cell, there no nested cells. can done syntax as: [cell2{:,:}]. returns cell 2xn. in order make able concatenated cell1, can use function reshape. therefore in all:

cell2expanded = reshape([cell2{:,:}], [], 3);  >>[cell1; cell2expanded] ans =       '1007_s_at'    [ 780]    'ddr1'       '1053_at'      [5982]    'rfc2'       '117_at'       [3310]    'hspa6'      '121_at'       [7849]    'pax8'       '1255_g_at'    [2978]    'guca1a'     '1294_at'      [7318]    'uba7'       '1316_at'      [7067]    'thra'       [        1]    [   3]    [     5]     [        2]    [   4]    [     6]     [        7]    [   9]    [    11]     [        8]    [  10]    [    12]     [       13]    [  15]    [    17]     [       14]    [  16]    [    18] 

which looking for.


Comments