A year containing a date or not
2 次查看(过去 30 天)
显示 更早的评论
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
Fromhere you can pick the required column,(first column corresponds to Sunday) and check whether the given day is present or not.
0 个评论
Walter Roberson
2020-7-3
year = 2050; month = 1;
has_sunday30 = weekday(datetime(year, month, 30)) == 1;
2 个评论
Walter Roberson
2020-7-3
input(). Or menu(). Or inputdlg() together with str2double() . Or use some popups or listboxes.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Dates and Time 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!