Excel to matlab timestamps -


i have data in excel in form of timestamps s looks

30/11/12 12:42 30/11/12 12:47 30/11/12 12:56 30/11/12 1:01 

i need matlab

datestrings = {... '30/11/12 12:42 am' ... '30/11/12 12:47 am' ... '30/11/12 12:56 am' ... '30/11/12 1:01 am' ...  }; 

i have tried xlsread doesn't put in strings.

the following works me (in octave, should same in matlab):

>> [num,txt,raw]=xlsread('dates.xls','a1:a4') num =    4.1243e+004   4.1243e+004   4.1243e+004   4.1243e+004  txt = {}(0x0) raw = {   [1,1] = 4.1243e+004   [2,1] = 4.1243e+004   [3,1] = 4.1243e+004   [4,1] = 4.1243e+004 }  >> datestr(num+datenum(1900,1,1,0,0,0)-2) ans =  30-nov-2012 00:42:00 30-nov-2012 00:47:00 30-nov-2012 00:56:00 30-nov-2012 01:01:00  >> whos ans variables in current scope:  attr name        size                     bytes  class ==== ====        ====                     =====  =====     ans         4x20                        80  char  total 80 elements using 80 bytes 

check out datestr function various output format options.

arnaud


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -