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

2 vues (au cours des 30 derniers jours)
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

Réponse acceptée

madhan ravi
madhan ravi le 4 Jan 2019
Modifié(e) : madhan ravi le 4 Jan 2019
matrix(:,~any(matrix==0,1))
% or
matrix(:,any(matrix==0,1))=[]
  7 commentaires
madhan ravi
madhan ravi le 4 Jan 2019
man ! give an example and your desired output
Riyadh Muttaleb
Riyadh Muttaleb le 4 Jan 2019
It works perfectly without ~ ; matrix(:,all(matrix==0))
Thanks a lot,

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by