MATLAB: How to change 10×2 cell array to 1x10cell array of [1×2 double]

cell arrays

I am working with two arrays:
exon_starts =
10×1 cell array
[67027889]
[67029663]
[67031028]
[67031451]
[67031950]
[67032793]
[67033875]
[67035994]
[67047785]
[67049018]
exon_ends =
10×1 cell array
[67028167]
[67029742]
[67031098]
[67031514]
[67032026]
[67032864]
[67033993]
[67036128]
[67047911]
[67049213]
I want to create a 1×10 cell array where each columns is [1×2 double]. I can only achieve this so far by manually taking elements from both arrays in the following manner, but this is quite laborious:
exons={[67027889 67028167],[67029663 67029742],[67031028 67031098],[67031451 67031514],[67032465 67032541],[67032793 67032864],[67033875 67033993],[67035994 67036128],[67047785 67047911],[67049018 67049213]}
I tried num2cell function, but this gives me 1×2 cell array {10×1 cell} {10×1 cell}

Best Answer

This simple line does exactly what you want:
exon = num2cell(cell2mat([exon_starts,exon_ends]),2)'
giving
>> exon{1}
ans =
67027889 67028167
>> exon{2}
ans =
67029663 67029742
etc