I am reading from an excel file. In one of the columns (which includes only very long numbers), the MATLAB imported it as CELL (because there's a heading).
This is the sample imported:
'980000684210053338'
These are my tries:
Converts to DOUBLE but numbers change
tableM.v1 = cellfun(@str2num,tableM.v1);
Converts to DOUBLE but numbers change
tableM.v1 = cellfun(@str2double,tableM.v1);
Converts to CHAR but numbers are correct
tableM.v1 = cell2mat(tableM.v1);
How do I convert this CELL to DOUBLE while maintaining the correct values?
Thanks
P.S. I am using MATLAB R2016a.
UPDATE:
I ran this code from the answers:
tableM.v1 = vpa(tableM.v1); % assuming tableM.v1 is a cellstr
And I received this error:
Warning: Support of strings that are not valid variable names or define a number will be removed in a future release. To create symbolic expressions, first create symbolic variables and then use operations on them.
In sym>convertExpression (line 1536)
In sym>convertChar (line 1441)
In sym>tomupad (line 1198)
In sym (line 177)
In cell2sym (line 28)
In sym>tomupad (line 1208)
In sym (line 177)
In vpa (line 44)
Error using symengine
New array must have the same number of elements as the original array.Error in sym/reshape (line 50)
ySym = mupadmex('symobj::reshape',x.s,args{:});Error in cell2sym (line 34)
S = reshape(sym([Csym{:}]), size(C));Error in sym>tomupad (line 1208)
xsym = cell2sym(x);Error in sym (line 177)
S.s = tomupad(x);Error in vpa (line 44)
ss = sym(s);