Exracting n characters from all elements of cell array

조회 수: 1 (최근 30일)
jnaumann
jnaumann 2014년 12월 22일
답변: Azzi Abdelmalek 2014년 12월 22일
Hi,
I have some data in the following form and would like to extract separate the date and time components, therefore creating two arrays; the first using characters 1:10 and the second characters 12:19.
date_time =
'01/01/2011 19:47:43'
'01/01/2011 19:47:43'
'01/01/2011 21:43:25'
'01/01/2011 21:07:19'
I'm sure its a trivial problem but I can't quite do it

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2014년 12월 22일
date1=datestr(date_time,'dd/mm/yyyy')
hour1=datestr(date_time,'HH:MM:SS')

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Types에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by