Plotting date time Hear rate and Stress in the same plot and/or in different plots
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Zaffar Mughal
el 28 de Mayo de 2019
Comentada: Peter Perkins
el 5 de Jun. de 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 comentarios
Respuesta aceptada
Peter Perkins
el 4 de Jun. de 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 comentarios
Peter Perkins
el 5 de Jun. de 2019
Those are questions that you, the data analyst, need to answer for yourself.
Más respuestas (0)
Ver también
Categorías
Más información sobre Graphics Objects en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!