MATLAB: Deleting rows and columns matrixsample I have a 359×479 matrix. I want to down-sample it by removing every 2nd, 4th, so on… row and column. Which is the best method? Best Answer try accessing x vector/matrix by index e.g.x = x( 1:2:end , 1:2:end ); Related SolutionsMATLAB: Deleting rows and columns K = [1 2 3 4; 5 6 7 8; 9 10 11 12; 13 14 15 16]nr=1;nc=1;K(nr,:)=[]K(:,nc)=[]nr1=4;nc1=4;K(nr1-1,:)=[];K(:,nc1-1)=[] MATLAB: Delete a row, or column. Not sure if you have a 1201x1 or a 1203x1. But to delete the last row:b(end,:) = [];To retain the first 1200 rows:b = b(1:1200,:);If b is 1201x1 these will give the same result.Since you have a column vector I really didn't need the : for the columns, but decided to include it since that form will work for a matrix also. Related QuestionEfficiently Deleting Matrix Columns/RowsDelete zeros rows and columnsDelete zeros rows and columnsDelete rows based on column valueDeleting rows and columns of a matrixDelete rows from matrix
Best Answer