필터 지우기
필터 지우기

Importing time values into matlab in format hh:mm without converting to demical

조회 수: 1 (최근 30일)
John
John 2012년 2월 11일
편집: dpb 2013년 10월 8일
Hello,
How can you import time values in the format hh:mm (i.e. 09:31 21:13) in a text file into matlab?
When I load like them in using this command, they get converted to decimal.
time=load('time.txt');
I also would like to plot a histogram of them.
Many thanks
John
  댓글 수: 2
per isakson
per isakson 2012년 2월 11일
Does the file consist of *one* line with *many* character strings of the format "hh:ss", which are separated by *one* space?
John
John 2012년 2월 12일
Hello,
The file is a text file consisting of one one column of 'time' values like this:
10:43
08:23
19:56
20:29
01:33
Thank you for the help

댓글을 달려면 로그인하십시오.

답변 (1개)

Walter Roberson
Walter Roberson 2012년 2월 11일
Do not use load() for this.
I do not know if importdata will work.
You can use textscan()
  댓글 수: 4
Walter Roberson
Walter Roberson 2012년 2월 11일
We would need to know the format of the lines in order to show you the textscan() format. The link Elige posted should give you some ideas.
John
John 2012년 2월 12일
Hello,
I looked at that link but that poster was importing dates and time and some other date, I just have times.
The times are all in one column in this format
12:57:00
15:19:00
08:07:00
10:36:00
I'm sorry if it an easy question but I just don't know what to type.
Thank you

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Data Import and Export에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by