Borrar filtros
Borrar filtros

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

1 visualización (últimos 30 días)
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.

Respuesta aceptada

Jon
Jon el 7 de Dic. de 2021
I think MATLAB's weekday function should do this for you, type doc weekday on the command line for details
  8 comentarios
Jon
Jon el 10 de Dic. de 2021
Editada: Jon el 10 de Dic. de 2021
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 el 11 de Dic. de 2021
it worked. Thank you for your assistance.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre MATLAB en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by