how to select a whole row in a matrix
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
hi, I have two matrices with 20 rows and 4 columns and I want to compare them using ismember. my problem is that i want to consider every row as a single input as if my matrices are 20x1 vectors.
how can i do that?
0 commentaires
Réponse acceptée
Jan
le 6 Déc 2022
Modifié(e) : Jan
le 6 Déc 2022
ismember(A, B, 'rows')
% Or maybe
ismember(A.', B.', 'rows')
4 commentaires
Jan
le 6 Déc 2022
nextEq = ~any(diff(A, 1, 1), 2)
diff() subtracts elements of an array along the dimension specified as 3rd input argument. any(X, 2) checks if any element along the 2nd dimension differs from zero.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Get Started with MATLAB 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!