MATLAB: C. Extract the sub-matrix containing all the rows but only columns 2 through 11 and name this matrix grades (to make this work on any size matrix, do not hard-code the 11, but rather use end or size).

how do I perform this action ? can any one help ?? reguards phil

Best Answer

Hi,
I'm not sure I understand your question. You should provide a concise title and a possibly detailed statement of the problem, not the other way round. Anyway, if I get it right, you have a matrix (say, M) and you want the submatrix containing all the rows and colums 2 trough some c. This matrix should be called grades. This is pretty simple.
L = 20; % size of M, for practical purposes
c = 11; % last column of the submatrix (of course c < L)
% create the submatrix (for practical purposes, you have it from your source)
M = rand(L);
% extract the desired submatrix
grades = M(:,2:c);