I am very new to programming, and cannot figure out how to run this program correctly. My work is shown below. Please Help!
time = clock ();
day = date ();
fprintf('The current date is %f\n', day);
fprintf('The current time is %0f\n', time);

 採用された回答

KSSV
KSSV 2021 年 2 月 8 日
d = datetime('now') ;
fprintf('The current date is %s\n', d);
The current date is 08-Feb-2021 05:19:58

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で Dates and Time についてさらに検索

質問済み:

2021 年 2 月 8 日

回答済み:

2021 年 2 月 8 日

Community Treasure Hunt

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

Start Hunting!

Translated by