I have a 2D-matrix, where the number of columns is always a multiple of 3 (for example 250×27) - due to the repetitive organization results ( A,B,C, A,B,C, A,B,Cetc.). I want to modify this matrix to create a new matrix with three columns - each of which contains aggregated data for each type ( A,B,C) (for example, 2250×3).
So, in the matrix, 250×27all the data in the columns 1,4,7,10,13,16,19,22,25will be combined to form the first column of the resulting modified matrix.
The second column in the resulting reconfigured matrix will contain all the data from the columns 2,5,8,11,14,17,20,23,26- etc.
Is there an easy way to do this in MATLAB? I only know how to use reshapeit if the columns that I wanted to merge were adjacent ( 1,2,3,4,5,6) and not non-adjacent ( 1,4,7,10,13,16), etc.