MATLAB: Error: Expression or statement is incorrect–possibly unbalanced (, {, or [.

errorsyntax

I am trying to choose specific rows from X which is 1149×13120 double. This is the code I am using:
X=([2
4
6],:);
Where 2 4 6 are pasted from an excel spreadsheet. For this particular analysis I only want to analyze data from these 3 subjects. This has worked for me in previous versions of MATLAB, but now I get the error above. Does anyone know what I am doing wrong?
Thanks.

Best Answer

After I edited your Question so I could see the formatting, the problem is that you need to reference a specific array, not simply the subscripts, and put everything on one line. Change the assignment to:
X_246 = X([2 4 6],:);
and if the rest of the array addressing is correct, it should run without error.
NOTE: This is obviously untested code.
Related Question