Filter löschen
Filter löschen

take jst the hour and munites from a vector

1 Ansicht (letzte 30 Tage)
moulay
moulay am 7 Jan. 2015
Beantwortet: Guillaume am 7 Jan. 2015
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

Antworten (1)

Guillaume
Guillaume am 7 Jan. 2015
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');

Kategorien

Mehr zu Dates and Time finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by