How can I remove zeroes column from matrix without removing NaN column?
1 view (last 30 days)
Show older comments
Riyadh Muttaleb
on 4 Jan 2019
Commented: Riyadh Muttaleb
on 4 Jan 2019
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
0 Comments
Accepted Answer
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
More Answers (0)
See Also
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!