Using Loop to Search through Time Stamps with sprintf

1 view (last 30 days)
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.

Answers (0)

Categories

Find more on Characters and Strings in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!