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

조회 수: 2 (최근 30일)
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

채택된 답변

madhan ravi
madhan ravi 2019년 1월 4일
편집: madhan ravi 2019년 1월 4일
matrix(:,~any(matrix==0,1))
% or
matrix(:,any(matrix==0,1))=[]
  댓글 수: 7
madhan ravi
madhan ravi 2019년 1월 4일
man ! give an example and your desired output
Riyadh Muttaleb
Riyadh Muttaleb 2019년 1월 4일
It works perfectly without ~ ; matrix(:,all(matrix==0))
Thanks a lot,

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by