Quantcast
Channel: MATLAB Central Newsreader Recent Posts
Viewing all articles
Browse latest Browse all 19628

Re: "Failed on converting date string to date number"

$
0
0
On 5/14/2013 2:20 PM, Barry Williams wrote:
...

> He's got two problems: the format string and the fact that all of four
> of the date/time strings are apparently in a single cell.

That doesn't explain why it doesn't succeed on the sample, tho...

And, while I've not used it in anger, doc for XLSREAD indicates the
second return value is a cell array so I'd not think that description
was accurate but a fignewton of newbie confusion more likely.

So, anyways, not having used it I pasted the OPs date strings into an
excel workbook and I get...

 >> [~,dn]=xlsread('book1.xls')
dn =
     '4.1.2012 06:00'
     '4.1.2012 07:00'
     '4.1.2012 08:00'
     '4.1.2012 09:00'
 >> datenum(dn,'mm.dd.yyyy HH:MM')
ans =
    1.0e+05 *
     7.3496
     7.3496
     7.3496
     7.3496
 >>

Now, if I tried to dereference the cell in any way, then I get the OPs
error message...

--



--

Viewing all articles
Browse latest Browse all 19628

Trending Articles