I'm trying to modify a matrix of unix timestamps, into groupings of days.
If I have a matrix like this.
matrix = [1392937181, 1392938000, 1392960000, 1392965000, 1342940000, 1342945000, 1342948000]
I would like to convert it to.
dayMatrix = [1, 1, 2, 2, 3, 3, 3]
Since (1392937181, 1392938000) both are on the first day, (1392960000, 1392965000) occur on a second day and (1342940000, 1342945000, 1342948000) occur on day 3. It is important to keep the number of elements in the matrix the same so that I can plot it against other data.
I know this sounds unusual, but its a requirement asked by a professor for a paper Im writing, but I can`t figure it out.
Any help is appreciated!
Cheers