필터 지우기
필터 지우기

Change the time format ?

조회 수: 1 (최근 30일)
Thar
Thar 2019년 4월 9일
댓글: madhan ravi 2019년 4월 10일
Hi!
I have the following time format:
80057
81409
91502
102514
and i want to take the format:
8:00:57
8:14:09
9:15:02
10:25:14
Any ideas?

채택된 답변

Bob Thompson
Bob Thompson 2019년 4월 9일
I'm assuming that you have an array of doubles. This works fine for the inputs, but will not be possible with the outputs. I am outputting the results as string, therefore.
A = [80057
81409
91502
102514];
B = num2str(A,'%06d');
C = repmat(':',size(B,1),1);
B = [B(:,1:2),B_1,B(:,3:4),B_1,B(:,5:6)];
  댓글 수: 3
Bob Thompson
Bob Thompson 2019년 4월 9일
Yes, sorry. That was a hold over from some other testing I was doing.
madhan ravi
madhan ravi 2019년 4월 10일
+1, no need to be sorry Bob, I liked your solution though ;)

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by