I have a simple question but I can\'t figure it out or find it anywhere. I have a cell array where c{1} is a vector and c{2} is a vector but of different lengths, up to c{i
The following one-liner even works for completely inconsistent inputs:
result = [cell2mat(cellfun(@(x) x(:), A, 'uni', 0)')]'
Example:
for:
A{1} = [1, 2, 3, 4, 5]; A{2} = [6; 7; 8; 9]; A{3} = [10, 12; 11, 13];
it returns:
result = 1 2 3 4 5 6 7 8 9 10 11 12 13