I recently switched to Matlab from R so, I am a beginner of Matlab. I have a very large dataset and below is the sample, MM2, for it. With the data MM2, I would like to divide MM2 into a unique number of MM1 (here is two, let's say N in my data) and remove all vectors of NaN for each of N subdata(there are two subdata below) and store each of subdata into one large array or something.
MM2 =
MM1 MM2 MM3 MM4 MM5 MM6
1 3 0 NaN NaN 1
1 3 3 NaN NaN 5
1 1 5 NaN NaN 7
1 3 5 NaN NaN 15
1 1 9 NaN NaN 1
1 1 10 NaN NaN 1
1 4 12 NaN NaN 5
1 2 13 NaN NaN 3
1 4 15 NaN NaN 5
1 2 16 NaN NaN 6
2 3 NaN NaN 1 0
2 3 NaN NaN 5 3
2 1 NaN NaN 7 5
2 3 NaN NaN 15 5
2 1 NaN NaN 1 9
2 1 NaN NaN 1 10
2 4 NaN NaN 5 12
2 2 NaN NaN 3 13
2 4 NaN NaN 5 15
2 2 NaN NaN 6 16
Tha is, I would like to have two data sets
First =
MM1 MM2 MM3 MM6
1 3 0 1
1 3 3 5
1 1 5 7
1 3 5 15
1 1 9 1
1 1 10 1
1 4 12 5
1 2 13 3
1 4 15 5
1 2 16 6
Second =
MM1 MM2 MM5 MM6
2 3 1 0
2 3 5 3
2 1 7 5
2 3 15 5
2 1 1 9
2 1 1 10
2 4 5 12
2 2 3 13
2 4 5 15
2 2 6 16
And, I would like to store N subdata into one large array, list or whatever (I don't know what is the right one, list in program R). How should I do it?