Azzera filtri
Azzera filtri

Using Loop to Search through Time Stamps with sprintf

1 visualizzazione (ultimi 30 giorni)
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.

Risposte (0)

Categorie

Scopri di più su Characters and Strings in Help Center e File Exchange

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by