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

1 回表示 (過去 30 日間)
notalwayssure
notalwayssure 2021 年 10 月 12 日
コメント済み: Walter Roberson 2021 年 10 月 12 日
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"

回答 (1 件)

Walter Roberson
Walter Roberson 2021 年 10 月 12 日
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 件のコメント
Walter Roberson
Walter Roberson 2021 年 10 月 12 日
you did not use the 's' option like I showed
Walter Roberson
Walter Roberson 2021 年 10 月 12 日
And why are you passing the result of the input() to input() as the prompt?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSpreadsheets についてさらに検索

タグ

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by