Borrar filtros
Borrar filtros

how to convert numbers to days names

3 visualizaciones (últimos 30 días)
MAHMOUD ALZIOUD
MAHMOUD ALZIOUD el 8 de Sept. de 2017
Comentada: MAHMOUD ALZIOUD el 8 de Sept. de 2017
Hello There, I am a PhD student and working on some traffic counting cards, the card has around 2900 rows and one column, the column has numbers from 1 to 31 covering the month days of January 2007, but each number is written 96 times (96 * 31 = 2900 which is the number of the rows). how can i convert the numbers to day names? for example number one what day was it in Jan 1st 2007? how can i do that to the whole cells?
thank you

Respuesta aceptada

Guillaume
Guillaume el 8 de Sept. de 2017
96*31 is 2976, not 2900.
I'm not really clear on the format of your input, but in any case use the day function to convert to day name. You'll have to convert your day number to datetime first, which is trivial to do:
democolumn = repelem((1:31)', 96); %if I understood correctly it's the format of your input but it does not really matter
columnasdayname = day(datetime(2007, 1, democolumn), 'name')
  1 comentario
MAHMOUD ALZIOUD
MAHMOUD ALZIOUD el 8 de Sept. de 2017
Thank you very much man for the answer it helped alot

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Data Import from MATLAB en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by