Your goal isn't clear (see comment under your question). But I think I understand what you're looking for.
Here I make the following assumptions
- You have a variable that identifies the subject for each row of your data.
- The rows of your 2340x5 matrix is organized by subject. So, the first 90 rows are s1, then 90 rows of s2, etc.
- The number of variables (in your case, 90) will always be even. If this is untrue, you'll have to use a cell array rather than a matrix and the two columns will be uneven.
- You want to extract data from 1 column at a time. ( This one was really unclear but since you want two columns in a matrix, this has to be the case).
If this is correct, you are not resizing the matrix (ie, using resize()), you are extracting a subset of data to create a new, smaller matrix.
Here I create fake data that fit your description and in 3 lines, I build the 2-column matrix extracting data from column 3 of your data.
nSubj = 26;
nVars = 90;
data = rand(nSubj * nVars, 5);
subjID = meshgrid(1:nSubj, 1:nVars);
subjID = subjID(:);
firstHalfIdx = repmat([true,false], floor(nVars/2), 1);
firstHalfIdx = repmat(firstHalfIdx(:), nSubj, 1);
col = 3;
dataHalves = [data(firstHalfIdx, col), data(~firstHalfIdx, col)];
dataHalves is a [1170-by-2] matrix where column 1 is the first half of data from all subjects and column 2 is the 2nd half - extracting data from column 3 of your data.
Best Answer