Plotting date time Hear rate and Stress in the same plot and/or in different plots
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Zaffar Mughal
il 28 Mag 2019
Commentato: Peter Perkins
il 5 Giu 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 Commenti
Risposta accettata
Peter Perkins
il 4 Giu 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 Commenti
Peter Perkins
il 5 Giu 2019
Those are questions that you, the data analyst, need to answer for yourself.
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Graphics Objects in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!