I am having a trouble of converting a string column in a table to a numeric type. I have a table imported from .csv file containing 6 columns with headers and 4 of them should be numeric and one is date in format yyyyMMddhhmm, delimitator is ','.
When I load it using readtable, it assumes that everything is a string and I can't convert the 4 columns to a numeric type. I have tried to convert it through many something2somethingelse converters, did not work.
I tried even:
data = readtable(['data' cell2mat(indexVars(i))], 'Format','%s%f%{yyyyMMddhhmm}D%f%f%f');
It returned:
Error using readtable (line 216)
Unable to read the entire file. You may need to specify a different format, delimiter, or number of header
lines.
Note: readtable detected the following parameters:
'Delimiter', ',', 'HeaderLines', 0, 'ReadVariableNames', true
Any ideas?
Best Answer