From: piero poli on
Hello,

I have a problem, that i don't how will be solved. I must load time series data in matlab matrix. The data are sampled at 5 hz, and there is a reference time t0. my idea is to use the reference time to calculate the position of the first sample:

N2=(z2.sec+z2.mn*60+z2.hr*3600)/z2.tau

where N2 is the point of the first sample. Naturally this number is not always real. When i'm going to load the data in matrix:

DataD(1,N2:z2.npts+N2-1)=z2.trace(1:z2.npts);

the N2 value is rounded, and so the point is shifted in time?

My first question is: did i make some mistake? my idea is wrong maybe.

More: how i can solve this?

THX in advanced
From: Sergey Holmogorov on
"piero poli" <pieropoli85(a)gmail.com> wrote in message <i144a4$4iv$1(a)fred.mathworks.com>...
> Hello,
>
> I have a problem, that i don't how will be solved. I must load time series data in matlab matrix. The data are sampled at 5 hz, and there is a reference time t0. my idea is to use the reference time to calculate the position of the first sample:
>
> N2=(z2.sec+z2.mn*60+z2.hr*3600)/z2.tau
>
> where N2 is the point of the first sample. Naturally this number is not always real. When i'm going to load the data in matrix:
>
> DataD(1,N2:z2.npts+N2-1)=z2.trace(1:z2.npts);
>
> the N2 value is rounded, and so the point is shifted in time?
>
> My first question is: did i make some mistake? my idea is wrong maybe.
>
> More: how i can solve this?
> You must reorganize your matrix, because N2 may be not integer, but matrix indexes must be integer.
> THX in advanced