Lets assume we have array M with size 1*100

M= [1 2 3 4 5 6 7 8 9 0 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 9 2 ....]

I need to rephase it to B matrix that have 12 rows with max column 9

B = [1 2 3 4 5 6 7 8 9 ; 0 1 1 1 1 1 1 1 NAN ; 1 1 2 2 2 2 2 2 9 2; ... etc]

if we notice the first row is 1*9

second row is 1*8

third row is 1*10

and so on until we fill all the 12 rows. The sizes for the rows [9 8 10 8 9 8 8 8 8 9 8 7]

I just make up this example becuase my array is too long and I need to divid it depend on three numbers which is 28, 31,30

I tried to make if loop to implmemt it but I cannot it's completely worng.

## 0 Comments

Sign in to comment.