can matlab handle data with microsecond precision and use it to create graph?

I'm using matlab to write graphic of stock price. On X I just use "number of microsecond elapsed from certain moment". So this is just integer value so matlab is easy to handle it. But it is not convenient because every time I have to "convert" "number of elapsed microseconds" to "time". I would prefer to see actual "time" instead.
Can matlab handle something like that "16:15:13:460882"? I need to create graph from the series of "time, value".
If so what format should I use? I need Matlab to understand that this is "time"

 채택된 답변

Walter Roberson
Walter Roberson 2012년 7월 21일
Unfortunately, MATLAB's date processing routines only extend to milliseconds; see http://www.mathworks.com/help/techdoc/matlab_prog/bspgcx2-1.html#bspgc4m-1
It could -- there is enough precision available to handle milliseconds up to year numbers above 100,000 -- but it does not.
You can apply your own time labels to a graph by setting XTickLabel or YTickLabel cell arrays of strings.

댓글 수: 2

actually I just realized that "milliseconds precision" is exactly what I actually need. Will matlab automatically recognize columns as "date" if I'm using dlmread function to read context of the file to variable and then I use plot to create graph? Thanks.
No, dlmread() expects numeric data. textscan() would give more flexibility. There is no "date" format field, though, so you would need to read the field as a string and then datenum() the strings.
There is a possibility that importdata() might recognize the file.

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Time Series Events에 대해 자세히 알아보기

제품

질문:

2012년 7월 21일

Community Treasure Hunt

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

Start Hunting!

Translated by