How to find position of a time vector in another time vector?
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi
I have two time vectors, one has random time spacing like A=[' 01/01/2001', '05/01/2001, ....], the other time vector has daily time like B=[' 01/01/2001', '01/02/2001', ....]. I like to find a position of each element of A in vector B. What is the fastest way? I don't want to write a loop for find each element. is there a faster way to output a position vector directly? Thanks a lot. I appreciate your help.
댓글 수: 1
채택된 답변
Jan
2017년 12월 12일
While I'm not sure what your inputs are, most likely this will solve the problem:
[ex, loc] = ismember(A, B)
댓글 수: 2
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!