readtable is interpreting columns of numbers from excel wrong
Afficher commentaires plus anciens
I have a spreadsheet with a few colomns of numbers. MatLab seems to recognise some of these as numbers but others seem to be cells?
Springs = readtable("SpringsLS.xlsx")
An image of the output below

Even when I move the colomns around and ensure formatting is the same it still makes my numbers into these, which I cant work with.
I've attached the excel doc
Réponse acceptée
Plus de réponses (1)
Mohammad Sami
le 1 Nov 2019
You can try and explicitly specify the format of your data.
opts = detectImportOptions('SpringsLS.xlsx');
disp(opts);
disp(opts.VariableTypes);
% use the following to set the conversion options if needed
% opts = setvartype(opts,{'RodDiametermm','HoleDiametermm'},'double');
data = readtable("SpringsLS.xlsx",opts);
Catégories
En savoir plus sur Data Import from MATLAB dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!