필터 지우기
필터 지우기

how to convert numbers to days names

조회 수: 3 (최근 30일)
MAHMOUD ALZIOUD
MAHMOUD ALZIOUD 2017년 9월 8일
댓글: MAHMOUD ALZIOUD 2017년 9월 8일
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')
  댓글 수: 1
MAHMOUD ALZIOUD
MAHMOUD ALZIOUD 2017년 9월 8일
Thank you very much man for the answer it helped alot

댓글을 달려면 로그인하십시오.

추가 답변 (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