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 view (last 30 days)
Show older comments
Commented: zhoug zho on 3 Jun 2021
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 on 3 Jun 2021
Edited: KSSV on 3 Jun 2021
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.
More Answers (0)
Find more on Get Started with MATLAB in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!