フィルターのクリア

take jst the hour and munites from a vector

1 回表示 (過去 30 日間)
moulay
moulay 2015 年 1 月 7 日
回答済み: Guillaume 2015 年 1 月 7 日
hi all!
i have a cellcontains time: hour:munites:second
%%T=
'15:09:16'
'15:09:17'
'15:09:17'
'15:09:18'
'15:09:18'
'15:09:18'
'15:09:19'
'15:09:19'
'15:09:19'
'15:09:20'
'15:09:20'
'15:09:20'
i want just the hours and minutes like this:
T= '15:09' '15:09' '15:09' '15:09' '15:09' '15:09' '15:09' '15:09' '15:09' '15:09' '15:09' '15:09'
Couls someone help?
Thank you all

回答 (1 件)

Guillaume
Guillaume 2015 年 1 月 7 日
There are many, many ways to do this, using cellfun, regexp, conversion to datevec or datetime, etc.
One way:
T = regexp(T, '\d+:\d+', 'match', 'once');

カテゴリ

Help Center および File ExchangeDates and Time についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by