I would like to remove rows and columns which are empty (contains more zeros than value) : for example
A=[0 0 0 0; 0 1 2 0; 8 5 8 2;5 8 2 7;0 1 0 0; 0 0 0 0]
to give output as
B=[5 8; 8 2]
matrix
A=[0 0 0 0; 0 1 2 0; 8 5 8 2;5 8 2 7;0 1 0 0; 0 0 0 0]
B=[5 8; 8 2]
Best Answer