Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
NCTM or The Math Forum.


Travis
Posts:
195
Registered:
1/31/08


time rounding issues
Posted:
Aug 20, 2014 1:50 PM


I have a large amount of data that is timestamped by the instruments recording it. When processing the data I need a complete time series, but there are times when there are gaps in the record that I need to fill. I have converted the timestring to MATLAB time and created another full time variable using...
time = t(1):1/48:t(end); %half hour data intervals
When I use the intersect command though I do not get the desired result; not all the times are the same (even though when I put them back to datestrings they are identical).
I set up a quick check...
a(:,1) = 1:1/48:100; b = 1; for i = 2:4753; %length of a b = [b;addtodate(b(i1),30,'minute')]; end
c = find(a ~= b); %3168 results.
Is this a rounding issue with the 1/48? Is there a way to do this without using a forloop and the addtodate command (I have seen the code slow down a lot when working with larger datasets)?



