how can remove the rows and columns which has ones in all
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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
0 commentaires
Réponse acceptée
madhan ravi
le 7 Juil 2019
use all() for columns and rows separately , make a copy of A to B and finally remove the unwanted
3 commentaires
Plus de réponses (1)
Andrei Bobrov
le 7 Juil 2019
A=[1 1 1 1; 1 0 1 1;1 0 0 1];
AA = ~A;
B = A(any(AA,2),any(AA));
0 commentaires
Voir également
Catégories
En savoir plus sur Multidimensional Arrays dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!