MATLAB: How to eliminate certain columns from a matrix matrix manipulation If I need to remove any column how do I do it? For example: s is a mxn matrix.I need to remove the odd columns i,e, the 1st,3rd.. columns. Best Answer Let A be matrix A(:,1:2:end) = [] % remove odd columnsA(:,3) = [] % remove third columnidx = [1 2 5 7] ;A(:,idx) = [] % remove columns specified in idx Related SolutionsMATLAB: Removing columns from a 5×5 matriz Indexing. The end keyword will also be of interest to you. MATLAB: Subtract row from previous row x(1:end-1)-x(2:end) Related QuestionHow to eliminate zeors in a matrixHow to eliminate rows with NaN elementsPlot selective columns eliminating fewRepeat last row at the end of matrix
Best Answer