MATLAB: How to remove zeroes column from matrix without removing NaN column zeroes Hi All, I have matrix contains zeroes columns and NaN columns and numbers columns, I want to remove [JUST zeroes columns] without removing NaN columns, Thanks in advance, Riyadh Best Answer matrix(:,~any(matrix==0,1)) % ormatrix(:,any(matrix==0,1))=[] Related SolutionsMATLAB: Removing zero columns from matrix matrix(:,any(matrix == 0))=[] % removes column if there is any zero in the columnmatrix(:,all(matrix == 0))=[] % removes column if the entire column is zero MATLAB: How to equalize column A = [ 1 2 3 4 5]B = [ 0 0 3]C=[A;B zeros(1,numel(A)-numel(B))] Related QuestionHow to interpolate columnMerge two columns into one columnRemoving columns containing zerosRemoving zeros from columnHow do i remove rows from a column based on the value of a corresponding columnRemove column from image
Best Answer