How to import dates from excel files
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Upon running the following code:
filename = 'Bitcoin_Data_Lab_9.xlsx';
A = xlsread(filename);
T = readtable(filename)
The outputs are similar to the spreashseet but not identical. A has completely deleted the dates column and only shows the numerical ones, while T has every column but every date which was in the dates column is now NaN (my dates are formatted as (mm/dd/yyyy). How can I make it so that the dates are displayed (preferably with xlsread but either function is acceptable).
For reference, the excel file is attached above.
2 commentaires
Mitchell Thurston
le 8 Déc 2021
my guess is you're going to want to interpret the dates column as a string. going off of this, it would be something like
opts = detectImportOptions(filename);
opts = setvartype(opts, 'Dates','string');
T = readtable(filename, opts)
Réponses (1)
Yusuf Suer Erdem
le 8 Déc 2021
Could you try like below?
filename = 'Bitcoin_Data_Lab_9.xlsx';
A = readcell(filename);
T = readtable(A)
Voir également
Catégories
En savoir plus sur Data Import from MATLAB dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!