find matching values from two unequal size arrays
44 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
akk
el 10 de Nov. de 2018
Comentada: akk
el 11 de Nov. de 2018
I have two arrays of unequal length. [lat1 lon1 pCO2] say 200000 values in each column [lat2 lon2] say 100000 values in each column
I want to find where both lat2=lat1 and lon2=lon1, then take the pCO2 value from the first array and plug it into the second array as a new column.
0 comentarios
Respuesta aceptada
Más respuestas (2)
Andrei Bobrov
el 10 de Nov. de 2018
Let:
a = [lat1 lon1 pCO2];
b = [lat2 lon2];
b(:,3) = a(ismember(a(:,1:2),b,'rows'),3);
Ver también
Categorías
Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!