how to convert numbers to days names

3 次查看(过去 30 天)
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

采纳的回答

Guillaume
Guillaume 2017-9-8
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')

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Data Import from MATLAB 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by