Prev: Wait a second!
Next: code
From: Alicia Lopez on
Hello!!
I have a problem. I have a cell array of dates and times and I want to calculate the hours that have been passed between two or more dates. I'm trying to calculate them with the serial date number given by the function datenum. But i only obtain changes in the serial date number when the day changes.
Does somebody know how can i get changes in the serial date number when the hour changes??Or does somebody know another way to get what i want??

Thank you very much.

Alicia
From: James Tursa on
"Alicia Lopez" <alisha_ibz(a)hotmail.com> wrote in message <hl0trl$rsb$1(a)fred.mathworks.com>...
> Hello!!
> I have a problem. I have a cell array of dates and times and I want to calculate the hours that have been passed between two or more dates. I'm trying to calculate them with the serial date number given by the function datenum. But i only obtain changes in the serial date number when the day changes.
> Does somebody know how can i get changes in the serial date number when the hour changes??Or does somebody know another way to get what i want??

datenum should work for you as long as the original dates & times have the required accuracy. Just subtract the two datenum values and then multiply by 24. What formula are you using?

James Tursa
From: Alicia Lopez on
Thank you very much James!! I just had calculated the datanums of the dates and i didn't see them changing, so i didn't the substract. Now, it works!!
Thank you very much again!

Alicia
 | 
Pages: 1
Prev: Wait a second!
Next: code