Cutting rows and columns from a matrix
Mostra commenti meno recenti
If A = [0,0,0,0;0,0,0,0;0,0,1,1;0,0,1,1], how can i cut out the null comumns and rows to acheive B = [1,1;1,1]
Risposta accettata
Più risposte (1)
Andrei Bobrov
il 20 Mag 2011
B = zeros(sum(any(A,2)),sum(any(A)));
B(:)=A(A~=0);
Categorie
Scopri di più su Interpolation in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!