From: bekoi on
jacklam(a)math.uio.no (Peter J. Acklam) wrote in message <wkitizj9c6.fsf(a)math.uio.no>...
> Pete Boettcher <boettcher(a)ll.mit.edu> writes:
>
> > You will want to do something like:
> >
> > >> datenum('May 17, 2001') - datenum(2001, 0, 0)
> >
> > ans =
> >
> > 137
>
> I would much rather use
>
> datenum('May 17, 2001') - datenum(2001, 1, 1) + 1
>
> Take the given date, subtract number of days since the first day
> of the year, and add one since we want the ordinal (not the
> cardinal) number.
>
> When was 2001-0-0? It never existed. It's an invalid date, but
> unfortunately DATENUM allows it. :-/
>
> Peter
>
> --
> If MATLAB crashes in the woods and there is nobody
> there to see it, does it really crash?




Thank you SO much! I'm very basic user of matlab and your post saved me :)
BR,
Bekoi