Borrar filtros
Borrar filtros

Using Loop to Search through Time Stamps with sprintf

1 visualización (últimos 30 días)
Nathan
Nathan el 22 de Mayo de 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.

Respuestas (0)

Categorías

Más información sobre Characters and Strings en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by