merge two cell in one single cell

I have two cells. one 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'
'1320_at' 11099 'PTPN21'
'1405_i_at' 6352 'CCL5'
'1431_at' 1571 'CYP2E1'
'1438_at' 2049 'EPHB3'
'1487_at' 2101 'ESRRA'
'1494_f_at' 1548 'CYP2A6'
'1598_g_at' 2621 'GAS6'
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
3x1 cell 3x1 cell 3x1 cell
3x1 cell 3x1 cell 3x1 cell
4x1 cell 4x1 cell 4x1 cell
3x1 cell 3x1 cell 3x1 cell
7x1 cell 7x1 cell 7x1 cell
I used cat to merge that but I did not get the result that I want:
'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 the result like cell 1 .
Any help will be highly appreciated

답변 (1개)

Walter Roberson
Walter Roberson 2016년 1월 24일

1 개 추천

[cell1; [vertcat(cell2{:,1}), vertcat(cell2{:,2}),vertcat(cell2{:,3})]]

댓글 수: 4

Ahmed
Ahmed 2016년 1월 24일
thank you @Walter
Sorry Walter I still have a problem the result come like this :
{1x1 cell} {1x1 cell} 'GUSB '
{1x1 cell} {1x1 cell} ' LOC100294451 '
{1x1 cell} {1x1 cell} ' LOC91316'
{1x1 cell} {1x1 cell} 'RHCE '
{1x1 cell} {1x1 cell} ' RHD'
{1x1 cell} {1x1 cell} 'PABPC1 '
{1x1 cell} {1x1 cell} ' RLIM'
{1x1 cell} {1x1 cell} 'LOC100288270 '
{1x1 cell} {1x1 cell} ' LOC100293638'
{1x1 cell} {1x1 cell} 'PCDHGA1 '
Walter Roberson
Walter Roberson 2016년 1월 25일
Could you post a small amount of the data for cell2 ? I tested before posting with data that looked to be like what you described.
Sure
2x1 cell 2x1 cell 2x1 cell
2x1 cell 2x1 cell 2x1 cell
inside each cell for example first row these data:
'200080_s_at' '3020' 'H3F3A '
'200080_s_at' '440926' ' LOC440926'

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기

태그

질문:

2016년 1월 24일

댓글:

2016년 1월 25일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by