MATLAB: How can remove the rows and columns which has ones in all

homeworkMATLAB

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

Best Answer

use all() for columns and rows separately , make a copy of A to B and finally remove the unwanted