Effacer les filtres
Effacer les filtres

Using Loop to Search through Time Stamps with sprintf

1 vue (au cours des 30 derniers jours)
Nathan
Nathan le 22 Mai 2013
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.

Réponses (0)

Catégories

En savoir plus sur Characters and Strings dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by