필터 지우기
필터 지우기

Convert time

조회 수: 3 (최근 30일)
Márcia Pereira
Márcia Pereira 2012년 3월 14일
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.

채택된 답변

Thomas
Thomas 2012년 3월 14일
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..

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Dates and Time에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by