Effacer les filtres
Effacer les filtres

how to extract a certain row out of a matrix

1 vue (au cours des 30 derniers jours)
farfar
farfar le 19 Juil 2018
Modifié(e) : jonas le 19 Juil 2018
Hello
How can I extract a certain rows out of a matrix ? for example:
a=[2 2;2 2;2 2;1 1;0 1;0 1;0 1]
I want to extract row [0 1] out a matrix a and have a new matrix b :
b=[0 1;0 1;0 1]
Thank you

Réponse acceptée

jonas
jonas le 19 Juil 2018
Modifié(e) : jonas le 19 Juil 2018
ind=ismember(a,[0 1],'rows');
b=a(ind,:)

Plus de réponses (0)

Catégories

En savoir plus sur Multidimensional Arrays dans Help Center et File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by