Effacer les filtres
Effacer les filtres

Convert time

3 vues (au cours des 30 derniers jours)
Márcia Pereira
Márcia Pereira le 14 Mar 2012
Hi, I'm a student at university and I'd like to convert time to values usable by matlab to calculate some variables.
The values of time I have are in a xls. file and they're writen like this one 8:15 (a quarter ast eight). I tried replacing : by . but it only makes matlab read it like a decimal number 8,15.
What I want is to convert that to eight hours and fifteen minutes. I have to do it in matlab because there are too many values in the excel file.

Réponse acceptée

Thomas
Thomas le 14 Mar 2012
You could try datestr,datenum
doc datestr
doc datenum
Eg. Suppose you have 8:15 in the text, xls file, import it as string
c='8:15';
datestr(c,'HH:MM')
ans =
08:15
or convert into datenum for further calculations..

Plus de réponses (0)

Catégories

En savoir plus sur Dates and Time 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