public Matrix removeColumn ( int j ) { if ( j >= columns || j < 0 ) { throw new IndexOutOfBoundsException ( "Illegal column number, must be 0.." + ( columns - 1 ) ) ; } Matrix result = blankOfShape ( rows , columns - 1 ) ; for ( int jj = 0 ; jj < j ; jj ++ ) { result . setColumn ( jj , getColumn ( jj ) ) ; } for ( int jj = j + 1 ; jj < columns ; jj ++ ) { result . setColumn ( jj - 1 , getColumn ( jj ) ) ; } return result ; }
Removes one column from matrix .