how do I import date from .xls where cell contains numbers and letters

1 vue (au cours des 30 derniers jours)
Ryan Dillingham
Ryan Dillingham le 4 Juin 2013
I am trying to import a .xls data file using [num, txt] = xlsread(filename);. I got the file to import giving me a number file and a text file. The text file includes the dates in format: [10-1-2005 0:05 MDT] all in one cell. I am trying to get the date and time into a datevector so that I can organize and graph the data in fractional years. Anyone know how I can extract the date and time and leave out the time zone?
Thanks in advance ryan
  2 commentaires
Azzi Abdelmalek
Azzi Abdelmalek le 4 Juin 2013
what is MDT?
Leah
Leah le 4 Juin 2013
It's to denote the timezone

Connectez-vous pour commenter.

Réponse acceptée

Leah
Leah le 4 Juin 2013
try strrep and replace with ''

Plus de réponses (1)

Azzi Abdelmalek
Azzi Abdelmalek le 4 Juin 2013
Modifié(e) : Azzi Abdelmalek le 4 Juin 2013
s={'10-1-2005 0:05 MDT';'11-1-2005 0:05 MDT'}
s=cellfun(@(x) datenum(strrep(x,'MDT','')),s)
dat=datestr(s,'dd-mm-yyyy HH:MM')

Catégories

En savoir plus sur Word games dans Help Center et File Exchange

Produits

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by