How can I remove zeroes column from matrix without removing NaN column?

1 view (last 30 days)
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

Accepted Answer

madhan ravi
madhan ravi on 4 Jan 2019
Edited: madhan ravi on 4 Jan 2019
matrix(:,~any(matrix==0,1))
% or
matrix(:,any(matrix==0,1))=[]
  7 Comments

Sign in to comment.

More Answers (0)

Categories

Find more on Numeric Types in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!