defining sample interval from Julian time

1 view (last 30 days)
Hi,
I am trying to define the sample interval of a data based on the time in Julian. In order to discover the sample interval I converted it to Gregorian time by gragorian(time). The result showed that the sample interval is variable along the series, varying between 1 to 4 seconds. Is that method effective to define the sample interval? Or is it possible to generate errors due to this conversion? Furthermore, I need to change the sample interval to 1 Hz, my idea is to open gaps equivalent to the difference between two consecutive cells (based on the "seconds" column), and interpolate it later. Is there any other method simplest to fix this sample interval?
Thanks in advance,
Gustavo

Accepted Answer

dpb
dpb on 15 Jun 2015
AFAICT there is no TMW-supplied function gregorian so can't speak of what that might have done regarding conversion of whatever form your input time vector was. The traditional datenum will convert what it's given accurately to msec precision so differences from that form of over that precision would indicate either an error in input using the function somehow or that the input data aren't sampled uniformly.
You'll have to determine by looking at the input for certain at a suspect area which of those two cases occurred with your data; we can't tell without data and a way to try reproduce the problem.
Note that in recent releases of Matlab there's a new timeseries object that has some facilities more easily used for the purpose than the old date numbers.

More Answers (0)

Categories

Find more on Dates and Time in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!