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