Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

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


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

Topic: Ismember/intersect not possible with serial date numbers?
Replies: 5   Last Post: Mar 6, 2013 4:03 PM

Advanced Search

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

Posts: 8,296
Registered: 6/7/07
Re: Ismember/intersect not possible with serial date numbers?
Posted: Mar 5, 2013 7:17 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On 3/5/2013 6:07 PM, Vegard wrote:
> TideMan <mulgor@gmail.com> wrote in message <ebb90dc8-6be0-4678-a0fc-
>>
>> If you're finding that "strange", then you don't understand/haven't
>> read the FAQ.
>> Look at this:

>> >> format long
>> >> 1/24/60

>>
>> ans =
>>
>> 6.944444444444444e-004
>> This is the increment you are using in generating year_serial1.
>> Clearly, there will be round-off error because of all those digits.
>>

>
> I'm sorry - I should have been more clear; what puzzled me about the
> example in my previous post was how the last two commands were able to
> fix the roundoff errors introduced by the first three. Apparently, the
> datevec function is quite clever.


Well, when you passed it the dateserial numbers that were off by 1 LSB
it rounded to nearest integer and that cleans up the "fuzz" by returning
the input to the next call to datenum() that you made to exact integers.

datenum() is, as shown in my example, very clever indeed...

> Thank you both for taking the time to answer in detail. I didn't fully
> understand what you meant in your first reply, dpd, but it is clear to
> me now. I certainly read the FAQ, and the Cleve's corner that was linked
> to from there, and I've learned some important stuff about floating
> point arithmetic!


I didn't say it as well as could have perhaps--I sorta' presumed that
the "using datenum consistently" would get through but it's easy to see
why that wasn't necessarily enough detail to get you over your hurdle
given what you had done (which is reasonable-enough on the face of it
until one realizes what you've now learned).

Good on the latter...if you haven't yet found it (I forget for sure but
I think there's perhaps a link in the FAQ) DAGS on "What Every Computer
Scientist..." and Goldberg for a very nice paper on the details of the
subject. Even if you don't study it thoroughly now, knowing it's there
when you need it can be priceless...

--



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

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.