MATLAB: Error using cell2mat

cell2matMATLAB

Hi all, I have a 309 * 5956 cell array of same type and same length. however most of the elements are empty.
However using cell2array to convert this matrix to numerical it gives me error as:
cell2mat(all_i_dis)
Error using cat
Dimensions of matrices being concatenated are not consistent.
Error in cell2mat (line 79)
m = cat(1,m{:});
any idea is highly appreciated.

Best Answer

A={ 1 , 2 ; [], 4};
cell2mat(A);
The result
Error using cat
Dimensions of matrices being concatenated are not consistent.
Error in cell2mat (line 87)
m = cat(2,m{:});
To use cell2mat, all cells must be the same size and same class