필터 지우기
필터 지우기

Using Loop to Search through Time Stamps with sprintf

조회 수: 1 (최근 30일)
Nathan
Nathan 2013년 5월 22일
I am trying to set up a loop that uses a matrix, x, with values from 1 through 30 to search through a cell of timestamps and eturns the indecies of each day. For example, a value of 20 from matrix x is placed into the format 1/x/2009 and searches through a matrix time_stamps and returns indecies of 1 to 1020.
Here's what I have so far for x=Date_List g=sprintf(' 1/%d/2009 ',x) ind=strmatch({'g'},time_stamps) end I have a few problems. g outputs as a 1x343 single character of dates and then I also don't know what format to put g into the strmatch function.
For a single date its just
ind=strmatch({'1/20/2009'},time_stamps)
and that works fine.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Characters and Strings에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by