MATLAB: How to split and transpose a cell array

cell arraytranspose

Hi !! I have the next cell composition (30*1 size)
What I want to do is to split it first, according to the "," so each different number has to occupy a diffierent column. Like this:
After this, I want to transpose all the numbers, so I want to have a final matrix size (7*30)
Can anyone help me to solve this?
Thanks in advance!

Best Answer

a={'12,13,14,45';'4,8,nan,nan';'450,2,14,nan'}
out=cell2mat(cellfun(@(x) str2num(strrep(x,',',' ')),a,'un',0))'