Plot large files with timestamp

2 ビュー (過去 30 日間)
Ancalagon8
Ancalagon8 2018 年 11 月 21 日
編集済み: Ancalagon8 2025 年 1 月 6 日
I have a large file and try to load it into MATLAB and plot it with timestamp.
  2 件のコメント
Jan
Jan 2018 年 11 月 21 日
What is your question?
Ancalagon8
Ancalagon8 2018 年 11 月 21 日
I need help loading and plotting my large csv file with timestamp.

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

回答 (1 件)

Walter Roberson
Walter Roberson 2018 年 11 月 21 日
strcat the first two columns together with a blank between . datetime the result with an InputFormat parameter , which is required for this purpose because datetime cannot figure out fractions of a second by itself .
Now that you have timestamps and values you can prepare to plot . I think your release permitted using datetime as the X axis .
  2 件のコメント
Walter Roberson
Walter Roberson 2018 年 11 月 21 日
That is more work. Time of day without an attached date is handled by duration objects. In your R2016b release, duration() did not support input as time strings, so to construct the objects it would be necessary to parse the character strings into arrays of numeric values that can then be passed to duration() . It is easier to
dt = datetime( strcat(testdata{:,1}, {' '}, testdata{:,2}), 'inputformat', 'yyyy-MM-dd HH:mm:ss.SSSSSS');
You can always convert those to duration afterwards:
dur = dt - dateshift(dt(1), 'start', 'day');
After which you can plot, such as
plot(dur, testdata{:,3:4})
Walter Roberson
Walter Roberson 2018 年 11 月 21 日
Like you posted,
testdata = read(ds);

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

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by