AA - suppose I just have a smaller matrix/table of 100 rows and 6 columns, created as
oneMinTbl = randi(255,100,6);
Presumably, the two minute table/chart will have half as many rows as you are combining rows 1 and 2, rows 3 and 4, etc. (Is this correct?)
Your code has to accomplish four things, with the first being to keep the columns 1 through 3 from each of the odd rows which will correspond to the beginning of each two minute period. We can do this as follows
oneMinTbl(1:2:end-1,1:3) % the first three columns from each odd row (less the last)
Note how we start at one and increment by two - so we choose rows 1, 3, 5, etc.
Next, the fourth column is the maximum value of the fourth column in rows 1 and 2 (or 3 and 4, etc.). We do this as
max([oneMinTbl(1:2:end-1,4) oneMinTbl(2:2:end,4)],[],2)
where we create a matrix of the fourth column (shifted accordingly) and get the maximum from each row. The temporary matrix has two columns with the first being made up from the column four data of the odd rows, and the second column being made up from the column four data of the even rows.
We can do the same for the fifth column as
min([oneMinTbl(1:2:end-1,5) oneMinTbl(2:2:end,5)],[],2)
And finally, the last column is just the closing price (sixth column) from each of the even rows
oneMinTbl(2:2:end,6)
Combining all of this together should create your two minute table
twoMinTable = [oneMinTbl(1:2:end-1,1:3) ...
max([oneMinTbl(1:2:end-1,4) oneMinTbl(2:2:end,4)],[],2) ...
min([oneMinTbl(1:2:end-1,5) oneMinTbl(2:2:end,5)],[],2) ...
oneMinTbl(2:2:end,6)];
Try the above and see what happens!
