Clear Filters
Clear Filters

how to convert numbers to days names

3 views (last 30 days)
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

Accepted Answer

Guillaume
Guillaume on 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')

More Answers (0)

Categories

Find more on Data Import from MATLAB in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!