Effacer les filtres
Effacer les filtres

Change the time format ?

1 vue (au cours des 30 derniers jours)
Thar
Thar le 9 Avr 2019
Commenté : madhan ravi le 10 Avr 2019
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?

Réponse acceptée

Bob Thompson
Bob Thompson le 9 Avr 2019
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 commentaires
Bob Thompson
Bob Thompson le 9 Avr 2019
Yes, sorry. That was a hold over from some other testing I was doing.
madhan ravi
madhan ravi le 10 Avr 2019
+1, no need to be sorry Bob, I liked your solution though ;)

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by