Asking a user in the command window to enter YYYY-MM-DD HH-MM-SS-MS

1 Ansicht (letzte 30 Tage)
notalwayssure
notalwayssure am 12 Okt. 2021
Kommentiert: Walter Roberson am 12 Okt. 2021
How do I create a script that asks for a user to input date/time data in the form YYYY-MM-DD HH-MM-SS-MS? I want the user to enter this information in the command window after I click "Run"

Antworten (1)

Walter Roberson
Walter Roberson am 12 Okt. 2021
T = input('Enter time in the form YYYY-MM-DD HH-MM-SS-MS: ', 's')
This will give back a character vector that has not been validated.
  3 Kommentare
Walter Roberson
Walter Roberson am 12 Okt. 2021
you did not use the 's' option like I showed
Walter Roberson
Walter Roberson am 12 Okt. 2021
And why are you passing the result of the input() to input() as the prompt?

Melden Sie sich an, um zu kommentieren.

Tags

Produkte


Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by