take jst the hour and munites from a vector
    조회 수: 3 (최근 30일)
  
       이전 댓글 표시
    
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
댓글 수: 0
답변 (1개)
  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');
댓글 수: 0
참고 항목
카테고리
				Help Center 및 File Exchange에서 Data Type Conversion에 대해 자세히 알아보기
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!