How to add hours:minutes in Matlab?

2 ビュー (過去 30 日間)
Tahariet Sharon
Tahariet Sharon 2021 年 1 月 28 日
コメント済み: Tahariet Sharon 2021 年 1 月 28 日
Let's say I have hours:minute data in format HH:MM, and want to do statistics with it. I want to have the data in minutes for instance to be able to do t-tests. How to go about this in Matlab? Thanks!

採用された回答

Walter Roberson
Walter Roberson 2021 年 1 月 28 日
t='10:10';
minutes(duration(t, 'inputformat', 'hh:mm'))
ans = 610
  3 件のコメント
Walter Roberson
Walter Roberson 2021 年 1 月 28 日
If it is a cell array of character vectors, use the call I provided.
Tahariet Sharon
Tahariet Sharon 2021 年 1 月 28 日
Ok, t should be then a cell array. Got it! Thanks!

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

その他の回答 (1 件)

KSSV
KSSV 2021 年 1 月 28 日
t='10:10';
[Y, M, D, H, MN, S] = datevec(t);
H*60+MN
  1 件のコメント
Tahariet Sharon
Tahariet Sharon 2021 年 1 月 28 日
I have a 100x1000 matrix of hh:mm data. How to simoultaneously convert them all?

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

カテゴリ

Help Center および File ExchangeData Type Conversion についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by