selection of particular rows from a matrix?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I would like to select rows from a matrix in a particular pattern as: row nos 1,2,3,5,6,7,9,10,11,13 and so on. Please help me in coding the loop.
0 commentaires
Réponses (1)
michio
le 23 Oct 2016
Modifié(e) : michio
le 23 Oct 2016
ismember function could do the work with 'rows' option.
Please check the example code with 'rows' option on the doc page.
1 commentaire
michio
le 24 Oct 2016
Very simple sample code follows.
A = [1,2,3; 2,3,1; 3,1,2];
B = [2,3,1];
idx = ismember(A,B,'rows')
A(idx,:)
Voir également
Catégories
En savoir plus sur Loops and Conditional Statements 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!