Borrar filtros
Borrar filtros

How to match two arrays

2 visualizaciones (últimos 30 días)
Yro
Yro el 6 de En. de 2021
Respondida: KSSV el 6 de En. de 2021
Hi, how can I make the match two following arrays? I want to obtain a 29x1 array with the position of the corresponding match.
Tried the following, performing a cell array for each position but I get what I want.
for i = 1:length(PATTERNS_FOR_ERANOS)
DATA_FROM_DAKOTA1{i} = find(POSICIONES_ERANOS(:,1) == PATTERNS_FOR_ERANOS(i,1));
DATA_FROM_DAKOTA2{i} = find(POSICIONES_ERANOS(:,2) == PATTERNS_FOR_ERANOS(i,2));
end
% 87x2 array
POSITIONS = [ ...
31 29
31 30
30 31
29 31
29 30
30 29
31 28
32 28
32 29
...
];
% 29x2 array
PATTERNS_FOR_ERANOS = [...
26 34
28 34
30 34
32 32
34 30
34 28
34 26
33 27
31 27
29 27
...
];
% 29x1 array
DATA_FROM_DAKOTA = [...
1
2
3
4
4
5
7
8
9
3
2
...
];
Thanks in advance.

Respuestas (1)

KSSV
KSSV el 6 de En. de 2021
Read about ismember.

Categorías

Más información sobre Matrices and Arrays en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by