フィルターのクリア

Plotting data with timestamps

26 ビュー (過去 30 日間)
lexi11
lexi11 2016 年 11 月 28 日
コメント済み: dpb 2018 年 10 月 31 日
Hi,
I have some data from a sensor and corresponding timestamps. How do I plot this data? (x axis - timestamps, y-axis - data) plot function gives empty figures. Probably because timestamps cannot be put in a linear scale. I tried semilogx - this also gives empty figures.
How do I do this?
Thanks in advance
  2 件のコメント
Ryan Smith
Ryan Smith 2016 年 11 月 28 日
Can you provide the data as an attachment?
lexi11
lexi11 2016 年 11 月 28 日
Hi, the timestamps are in unix format. I have attached a set of them. Since in excel it shows as 1.48E+10 format, I have changed the type in excel to 'number' so that you can see the entire number. So it adds .00 in the end to each value, but originally I get in the 1.48E+10 like number representation. Thank you.

サインインしてコメントする。

採用された回答

dpb
dpb 2016 年 11 月 28 日
編集済み: dpb 2016 年 11 月 28 日
Convert from whatever format the timestamps are in to a Matlab representation of dates...with R2014 up, there's the datetime class; prior to that use datenum. See <datetime> for current versions; plot is datetime -aware.
  7 件のコメント
Peter Perkins
Peter Perkins 2018 年 10 月 31 日
In recent versions of MATLAB, you can also convert directly from ms since 1970:
>> datetime(1489337264031,'ConvertFrom','EpochTime','TicksPerSecond',1000,'Format','dd-MMM-yyyy HH:mm:ss.SSS')
ans =
datetime
12-Mar-2017 16:47:44.031
The 'Epoch' parameter defaults to 1-Jan-1970, which is convenient if you have posix timestamps.
dpb
dpb 2018 年 10 月 31 日
Thanks for making aware of that, Peter...

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCalendar についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by