Find index between two vectors

조회 수: 2 (최근 30일)
Cary
Cary 2015년 7월 6일
답변: Cary 2015년 7월 6일
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.

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2015년 7월 6일
편집: Azzi Abdelmalek 2015년 7월 6일
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'))

추가 답변 (1개)

Cary
Cary 2015년 7월 6일
Thank you Azzi!

카테고리

Help CenterFile Exchange에서 Dates and Time에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by