MATLAB: Pointer Setting for identifying time of corresponding data

data pointerMATLABpointer

I have a set of Data which has been optimised by Matlab. This Output Data is a matrix and after optimisation the decimal input values get converted into binary output values of 9 bits per value. Each set of 9 values in it corresponds to data for a set of time.
I need to now set a pointer to tell which set of 9 values belongs to which time step and onward based on its position. I'm quite puzzled on this issue, could anyone please advise me on how I could approach this issue?
For my data, 9 values represents 1 hour of data for 1 device and i have 105 hours of recording for 10 devices so 9450 (945×10) values in this matrix. Thanks!

Best Answer

Let's see if I have your situation right.
Your measurements are stored in a 9450x10 matrix where each row is a row corresponds to a measurement time and each column corresponds to a device.
Your time stamp is a 105 x 1 cell array where each element is a string containing the timestamp associated with 9 measurements made for each of the 10 devices during that hour. So each time stamp is associated with 90 different measurements.
You want a way of looking at something like measurement 12 on device 8 and figuring out that the time stamp is '0001H' .
In that case, you can associate each row of measurements with a time stamp by creating a 945x1 time stamp array. If your initial time stamp array is called baseTsArray, and you make 9 measurement per hour:
measurementsPerHour = 9;
expandedTsArray = reshape( repmat( baseTsArray , 1 , measurementsPerHour)' , [] , 1);
The new time stamp array would look like this:
expandedTsArray =
'0001H'
'0001H'
'0001H'
'0001H'
'0001H'
'0001H'
'0001H'
'0001H'
'0001H'
'0002H'
...
'0105H'
'0105H'
'0105H'
'0105H'
The time stamp associated with data(n,D) would be given by expandedTsArray{n} .