A year containing a date or not
Mostrar comentarios más antiguos
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
2 comentarios
madhan ravi
el 3 de Jul. de 2020
If that month contains 30 as sunday?
Silpa K
el 3 de Jul. de 2020
Respuestas (3)
KSSV
el 3 de Jul. de 2020
0 votos
Fromhere you can pick the required column,(first column corresponds to Sunday) and check whether the given day is present or not.
Walter Roberson
el 3 de Jul. de 2020
year = 2050; month = 1;
has_sunday30 = weekday(datetime(year, month, 30)) == 1;
2 comentarios
Silpa K
el 3 de Jul. de 2020
Walter Roberson
el 3 de Jul. de 2020
input(). Or menu(). Or inputdlg() together with str2double() . Or use some popups or listboxes.
madhan ravi
el 3 de Jul. de 2020
strcmp(string(datetime(2050,30,1,'format','eeee')),"Sunday")
2 comentarios
Silpa K
el 3 de Jul. de 2020
madhan ravi
el 3 de Jul. de 2020
Use input() for 2050 and 1.
Categorías
Más información sobre Dates and Time en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!