Azzera filtri
Azzera filtri

Convert time

3 visualizzazioni (ultimi 30 giorni)
Márcia Pereira
Márcia Pereira il 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.

Risposta accettata

Thomas
Thomas il 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..

Più risposte (0)

Categorie

Scopri di più su Dates and Time in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by