MATLAB: Error when applying cell2mat

cell arraycell2matdoubleMATLAB

I have several columns in a cell array A with double values, and I am applying this very simple formula to get separate variables:
y=cell2mat(ANALLSper(:,2)); %for example
And for somecase ist gives me this error:
Error using cell2mat (line 45)
All contents of the input cell array must be of the same data type.
Does someone know how to solve it? Thank you very much.

Best Answer

Check it manually:
all(cellfun('isclass', ANALLSper(:,2), 'double'))
Related Question