MATLAB: Read a column as numbers

MATLABreadtable

I have a column with a large number of "NA" and a few numbers. When I import this from a csv file using readtable, matlab reads it as cell array. Even table2array returns a cell array instead of double. How do I read it / convert it as a column of numbers with NaNs for the "NA"s? My code is as below:
data=readtable("Data.csv");
t=table2array(data);
class(t)
ans =
'cell'

Best Answer

This works just fine for me.
data=readmatrix('Data.csv');
Related Question