MATLAB: I have a cell array of size 136 by 1 and i want it to convert it to array of type double. How can i do this

cellcell arraysconvert

I'm using str2double but after conversion this gives me some values as 'NAN'. How to resolve this?

Best Answer

What is in your cell array?
If it is only numeric, the cell2mat function will work. If it also has non-numeric element (such as strings), you need to separate them:
Example
C = {1 2 3 'Hi!' 4 5 'there!' pi};
numlidx = cellfun(@isnumeric, C);
Num = [C{numlidx}] % Numeric Data
Str = C(~numlidx) % Non-Numeric Data