Compare two matrices by 2 columns and erase the different rows

2 visualizaciones (últimos 30 días)
Hi, i have two matrices of coordeantes of different row size (#node x y z). I need to compare them and pick the rows that share same coordenates x and y between the two matrices, so the result would be a second matrix with the same row size as the first one. Basically I need to find the same points but in another z value. Any help with that will be appreciated :) Thanks!

Respuesta aceptada

Walter Roberson
Walter Roberson el 21 de En. de 2020
[has_a_match, row_index_in_second_matrix] = ismember(XYFromFirstMatrix, XYFromSecondMatrix, 'rows');

Más respuestas (0)

Categorías

Más información sobre Startup and Shutdown en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by