3D plot Datetime Data daywise

3 views (last 30 days)
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 Comments
Jeffrey Clark
Jeffrey Clark on 11 Jun 2022
@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 on 13 Jun 2022
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.

Sign in to comment.

Accepted Answer

Patrick Baumann
Patrick Baumann on 12 Jun 2022
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.

More Answers (0)

Categories

Find more on Dates and Time in Help Center and File Exchange

Products


Release

R2021b

Community Treasure Hunt

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

Start Hunting!