3D plot Datetime Data daywise

6 ビュー (過去 30 日間)
Patrick Baumann
Patrick Baumann 2022 年 6 月 9 日
コメント済み: Peter Perkins 2022 年 6 月 13 日
I have data recorded over several days with datetime format. Those are not continious recordings, only on a event the data is recorded for several seconds with a resolution of 10 Hz.
What i want is to plot those recodings in a 3D plot, x-Axis seconds of a day, y-axis the value of the recording and on the z-axis the different days, with to goal to see if the patterns are occuring around the same time during the days.
I fail at creating arrays / or matrices with matching dimensions, since the recordings are not deterministic. I was thinking about creating a "index column" from 0 to 86400000 for milisecons of a whole day and similar to excel combine the data with a "vlookup" function. But then i'll end up with out of memory problems.
Is there a better way to do this?
  3 件のコメント
Jeffrey Clark
Jeffrey Clark 2022 年 6 月 11 日
@Patrick Baumann if you are having a problem spliting your datetime into the time (x) and day(z) see Dates and Time - MATLAB & Simulink (mathworks.com)
Peter Perkins
Peter Perkins 2022 年 6 月 13 日
This relatively new syntax
[TOD,DATE] = timeofday(DT) also returns an array of datetimes equal to the date
portion of DT, i.e. DATESHIFT(DT,'start','day').
So, given a timetable tt:
[tt.ToD,tt.Date] = timeofday(tt.TimeStamp);
is especially useful for splitting into ToD and date. Depending on what kind of plot you want, plot3 using tt.ToD, tt.Date, and tt.Value might be all you need, or you might need to loop over days and plot each subset separately.

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

採用された回答

Patrick Baumann
Patrick Baumann 2022 年 6 月 12 日
Thanks, i think i found a solution:
I am using plot3, so for the z-axis i take second of day sexond(blabla.time, 'secondofday'), for x-axis the actual measurement and for y-axis day of year day(blabla.time, 'dayofyear')
So in the end i have something like:
plot3(second(bla.time, 'secondofday'), bla.measurement, day(bla.time, 'dayofyear'));
I don't need to do any padding or combine different days of measurement, i can take the whole datastream (datetime + measurement) in one take to make a nice 3D plot to see patterns over the time of a day for several days.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDates and Time についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by