필터 지우기
필터 지우기

i am trying to write a program to find the day of any date.

조회 수: 1 (최근 30일)
paul Erameh
paul Erameh 2021년 12월 7일
댓글: paul Erameh 2021년 12월 11일
im trying to find the day of any month
yyyy/mm/dd
2020/12/22...tuesday....this an example
Im trying to write the code so that when i run it it would ask for input and then present the answer.

채택된 답변

Jon
Jon 2021년 12월 7일
I think MATLAB's weekday function should do this for you, type doc weekday on the command line for details
  댓글 수: 8
Jon
Jon 2021년 12월 10일
편집: Jon 2021년 12월 10일
If you type on the command line
[dayNumber,dayName] = weekday('2020/12/22')
You should get
dayNumber =
3
dayName =
'Tue'
What is the result for you ? Are you getting an error?
If you get an error, please type
which weekday
You should get something like:
C:\Program Files\MATLAB\R2021b\toolbox\matlab\timefun\weekday.m
Please copy and paste the result of both of these commands so that we can see what your problem is.
paul Erameh
paul Erameh 2021년 12월 11일
it worked. Thank you for your assistance.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

태그

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by