Effacer les filtres
Effacer les filtres

how to convert numbers to days names

3 vues (au cours des 30 derniers jours)
MAHMOUD ALZIOUD
MAHMOUD ALZIOUD le 8 Sep 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

Réponse acceptée

Guillaume
Guillaume le 8 Sep 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 commentaire
MAHMOUD ALZIOUD
MAHMOUD ALZIOUD le 8 Sep 2017
Thank you very much man for the answer it helped alot

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Data Import from MATLAB dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by