how can remove the rows and columns which has ones in all
Show older comments
if the input array A i want B is the output
A=[1 1 1 1; 1 0 1 1;1 0 0 1]
A =
1 1 1 1
1 0 1 1
1 0 0 1
B =
0 1
0 0
thanks
Accepted Answer
More Answers (1)
Andrei Bobrov
on 7 Jul 2019
A=[1 1 1 1; 1 0 1 1;1 0 0 1];
AA = ~A;
B = A(any(AA,2),any(AA));
Categories
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!