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

1 visualizzazione (ultimi 30 giorni)
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

Risposta accettata

madhan ravi
madhan ravi il 4 Gen 2019
Modificato: madhan ravi il 4 Gen 2019
matrix(:,~any(matrix==0,1))
% or
matrix(:,any(matrix==0,1))=[]
  7 Commenti
Riyadh Muttaleb
Riyadh Muttaleb il 4 Gen 2019
It works perfectly without ~ ; matrix(:,all(matrix==0))
Thanks a lot,

Accedi per commentare.

Più risposte (0)

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by