Plotting date time Hear rate and Stress in the same plot and/or in different plots
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Zaffar Mughal
am 28 Mai 2019
Kommentiert: Peter Perkins
am 5 Jun. 2019
Hi htere,
i have a CSV file (containing Date, Sleep Time, Heart Rate and Stress data) which I am attaching as well. I want to plot date on the x-axis (all dates with only one day iteration),
then I want to see how much the person slept each day?
How much was his Hear Rate every day?
How much was the Stress Level every day?
i am totally new to the MATLAB so don't know much differences between tableread and csv read plus a newbie on syntax as well. Struggling a lot. Also, if someone could kindly help what other patterns can be made/obtained using this data would be great!
Many thanks in advance!
0 Kommentare
Akzeptierte Antwort
Peter Perkins
am 4 Jun. 2019
After a bit of cleaning up, I get this timetable:
>> TT = readtimetable('SHS.csv');
>> TT.Time.Format = "dd-MMM-yyyy";
>> TT.Var3 = duration(TT.Var3,"Format","hh:mm");
>> TT = TT(:,3:5);
>> TT.Properties.VariableNames = ["SleepTime" "HeartRate" "Stress"]
TT =
84×3 timetable
Time SleepTime HeartRate Stress
___________ _________ _________ ______
21-Feb-2019 09:00 60 41
22-Feb-2019 06:09 68 34
23-Feb-2019 09:18 61 14
24-Feb-2019 08:00 63 24
25-Feb-2019 07:30 67 26
26-Feb-2019 07:04 66 20
[snip]
Plotting is easy, perhaps this:
>> plot(TT.Time,TT.SleepTime)
or perhaps this:
>> stackedplot(TT)
2 Kommentare
Peter Perkins
am 5 Jun. 2019
Those are questions that you, the data analyst, need to answer for yourself.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Graphics Objects finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!