Borrar filtros
Borrar filtros

Find row in matrix.

200 visualizaciones (últimos 30 días)
Artyom
Artyom el 13 de Jul. de 2012
Respondida: Sonia PAGUI el 5 de Oct. de 2021
Hi, everyone. There are some data in array:
A=[3 3 2011;22 3 2011;23 3 2011;24 3 2011;25 3 2011;26 3 2011;27 3 2011];
I'm trying to find matching data using 'ismember':
B=[23 3 2011;27 3 2011];
[tf, index]=ismember(A,B);
But A(1,1) is also written as correct value. How can I solve it?

Respuesta aceptada

Honglei Chen
Honglei Chen el 13 de Jul. de 2012
[tf, index]=ismember(A,B,'rows');
  1 comentario
vvf vvff
vvf vvff el 26 de Feb. de 2020
thanks !!!!!!!!!!!!!!!!!!!!!!!!

Iniciar sesión para comentar.

Más respuestas (2)

Artyom
Artyom el 13 de Jul. de 2012
Ok, and if we have:
A=[3 3 2011 3 6;
22 3 2011 7 3;
23 3 2011 6 4;
24 3 2011 1 3;
25 3 2011 5 4;
26 3 2011 9 7;
27 3 2011 3 2];
  2 comentarios
Honglei Chen
Honglei Chen el 13 de Jul. de 2012
Editada: Honglei Chen el 13 de Jul. de 2012
Then simply do
[tf, index]=ismember(A(:,1:3),B,'rows');
BTW you may want to update your problem next time instead of adding an answer to rephrase the question.
Artyom
Artyom el 13 de Jul. de 2012
Thank you.

Iniciar sesión para comentar.


Sonia PAGUI
Sonia PAGUI el 5 de Oct. de 2021
Salut Mon code affiche l'erreur a propos de "find_row_array" quelqu'un peut m'aider???

Categorías

Más información sobre Logical en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by