how can i separate those columns which have same number of rows (e.g. the highlighted ones with fixed 7 rows ) by excluding zeros?

조회 수: 1 (최근 30일)
how can i separate those columns from the data arrays which have same number of rows (e.g. the highlighted ones with fixed 7 rows ) by excluding zeros?

채택된 답변

KSSV
KSSV 2021년 6월 3일
편집: KSSV 2021년 6월 3일
Let A be your matrix.
B = A(:,sum(A>0)==7) ; % pick the required columns
iwant = B(sum(B,2)>0,:) ; % remove the zeros if any in rows
I have assumed that all the numbers are positive in A.

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by