Effacer les filtres
Effacer les filtres

Excel Date Format to Matlab Number Array

2 vues (au cours des 30 derniers jours)
Franco
Franco le 27 Fév 2013
I have excel data, of which one column is in excel date format of the type '02/12/2013'. When I use xlsread, matlab gives me a number. I need to get matlab to give me an array. For instance, if 2 cells contain '02/03/2013' and '02/04/2013', I want matlab to give me an array of the following type, [02,02;03,04;2013,2013]. Anyone out there know how to do that? Thanks in advance.

Réponse acceptée

Craig Cowled
Craig Cowled le 27 Fév 2013
Have you tried using datevec?
Take one of the cells as an example ... '02/03/2013'.
>> datevec('02/03/2013','mm/dd/yyyy')
ans =
2013 2 3 0 0 0
  1 commentaire
Franco
Franco le 28 Fév 2013
Worked...Thanks!

Connectez-vous pour commenter.

Plus de réponses (0)

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!

Translated by