I have two vectors, both formatted as double.
Vector "A" is mx2. The first column contains continuous timesteps and the second column data from a measurement series.
Vector "B" is a nx2 (1<n<m) and contains several timestamps which match to some of the timesteps in vector "A".
Now I want to split vector "A" into a matrix "M". The Matrix should start a new column, each time, the timesteps of "A" corrspond with the timestamps in the first column in vector "B" and end when they correspond with the one in the second column.
So in each row of "B", the two timestamps define a column of the matrix "M".
As the sequences between two timestamps doesn't have the same length, every row should be filled up with 0 up to a fix row. For example row 5.
The matrix should only contain the measurement data and none of the timestamps. The matrix should be formatted as double.
In an example it would look like:
vector A [18 x 2]:
1. column [11:13:30 11:13:31 11:13:32 11:13:33 11:13:34 11:13:35 11:13:36 11:13:37 11:13:38 11:13:39 11:13:40 11:13:41 11:13:42 11:13:43 11:13:44 11:13:45 11:13:46 11:13:47]
2. column [6000, 6500, 5000, 8000, 15000, 15500, 16000, 6000, 4000, 16500, 14000, 400, 5000, 6000, 9000, 12000, 13000, 5000]
vector B [3 x 2]:
1. column [11:13:33 11:13:39 11:13:44]
2. column [11:13:36 11:13:40 11:13:46]
matrix M [3 x 6]:
1. column [8000 15000 15500 16000 0]
2. column [16500 14000 0 0 0]
3. column [9000 12000 13000 0 0]
This seems like a quite complex thing to me and I hope anybody can help me with this.
Bis smaller thanA, but in the text it is written that they're the same size. Please fix your post. - Cris LuengoAandBboth have 2 columns but can differ in the amount of their rows. But of course they don't have the same size. - ChrisAandBcell arrays? Are the time stamps encoded as numeric values or strings? - gnoviceAandBare formatted asdouble. Therefore, the timestamps inB, as well as the timeseries inA, are encoded as numeric value. - Chris