Filter löschen
Filter löschen

Convert time

3 Ansichten (letzte 30 Tage)
Márcia Pereira
Márcia Pereira am 14 Mär. 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.

Akzeptierte Antwort

Thomas
Thomas am 14 Mär. 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..

Weitere Antworten (0)

Kategorien

Mehr zu Dates and Time finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by