Find index between two vectors

2 visualizaciones (últimos 30 días)
Cary
Cary el 6 de Jul. de 2015
Respondida: Cary el 6 de Jul. de 2015
Good Afternoon,
I have a matrix of datevecs. So it looks like this:
2015 1 1 14 59 0
2015 1 1 15 0 0
I need to find the index where the 4th column is 14 AND the 5th column is 59.
I appreciate everyone's help.

Respuesta aceptada

Azzi Abdelmalek
Azzi Abdelmalek el 6 de Jul. de 2015
Editada: Azzi Abdelmalek el 6 de Jul. de 2015
A=[2015 1 1 14 59 0
2015 1 1 15 0 0]
idx=find(A(:,4)==14 & A(:,5)=59)
or
idx=find(ismember(A(:,4:5),[14 59],'rows'))

Más respuestas (1)

Cary
Cary el 6 de Jul. de 2015
Thank you Azzi!

Categorías

Más información sobre Dates and Time en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by