Working with dates separating seconds - dates return the same value. What am I doing wrong?

I am trying to plot events on the time axis. Events are spaced milliseconds. If I convert the timestamp of two events to a date, I get the same result for different timestamps. See the following output:

datenum(2011,06,13,15,11,05.500) ans = 7.3467e+005 datenum(2011,06,13,15,11,06.500) ans = 7.3467e+005 

The time between these two dates is one second. What am I doing wrong? Is there a way I can work with time?

Thanks -Daniel

+4
source share
1 answer

Daniel, just save the data in a variable, there is a difference that is too small, given your accuracy:

 a = datenum(2011,06,13,15,11,05.500) b = datenum(2011,06,13,15,11,06.500) b - a datevec(ba) a = 7.3467e+05 b = 7.3467e+05 ans = 1.1574e-05 ans = 0 0 0 0 0 1 
+6
source

All Articles