A year containing a date or not
이전 댓글 표시
How can I check a year containing a specified date or not.
eg. 2050 contain a as a sunday in a date 30.
input is like: 1,2050(januvary 2050)
output : true because it contain 30 as a sunday
답변 (3개)
KSSV
2020년 7월 3일
0 개 추천
Fromhere you can pick the required column,(first column corresponds to Sunday) and check whether the given day is present or not.
Walter Roberson
2020년 7월 3일
year = 2050; month = 1;
has_sunday30 = weekday(datetime(year, month, 30)) == 1;
댓글 수: 2
Silpa K
2020년 7월 3일
Walter Roberson
2020년 7월 3일
input(). Or menu(). Or inputdlg() together with str2double() . Or use some popups or listboxes.
madhan ravi
2020년 7월 3일
strcmp(string(datetime(2050,30,1,'format','eeee')),"Sunday")
카테고리
도움말 센터 및 File Exchange에서 Dates and Time에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!