The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Comparison of time entries
Replies: 11   Last Post: Apr 25, 2012 1:33 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]

Posts: 9,850
Registered: 6/7/07
Re: Comparison of time entries
Posted: Apr 25, 2012 10:12 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On 4/25/2012 8:54 AM, dpb wrote:
> a) A datenum value for a time w/o a date will be a fractional portion of
> a day, not a value including a full number of days since the reference
> time, and


> >> start = datenum('14:32:41','hh:mm:ss')
> start =
> 0.6060

> >> endt = datenum('15:00:49','hh:mm:ss')
> endt =
> 0.6256

> >> endt-start
> ans =
> 0.0195

> >>

Oh, I overlooked something that may be the issue--the DATESTR formats
for time fields are documented as 'HH:MM:SS', not lowercased versions of
same. I couldn't find any definitive words about how they're
interpreted in the latest versions (not to say aren't there just I
didn't find it) but m, mm, etc., are month fields, not time minute fields.

In the older version here, it seems to cope as demonstrated; perhaps the
newer version is literally trying to do its best to comply and that's
where the mixup of days is coming from for a time field only.


start = datenum('14:32:41','HH:MM:SS')
endt = datenum('15:00:49','HH:MM:SS')

and see if that doesn't bring joy...


Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.