Errorbars with standard deviation
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
How do I graph average bedtime in hours with a standard deviation error bar? I want the y axis to reflect times from 8pm to 6am. Also not sure how to scale x axis. The average bedtime was 1:37am and the std was 2.07.
5 commentaires
Peter Perkins
le 8 Juil 2019
Michael, by your description you have 21 times; if that is a datetime array, it's easy to compute the mean (as a datetime) and the std dev (as a duration). But what's not clear is how many of those series you have. You mention scaling the x axis, but nothing more. I'm guessing maybe you have multiple subjects and want to plot each subject's mean with error bars.
This might be super easy if you have a timetable with all the data together, with a variable identifying which times go with which subject. Then you could use varfun, grouping by subject, to compute vectors of by-subject means and std devs, and plot them
But I think you're gonna need to provide more details.
Réponses (0)
Voir également
Catégories
En savoir plus sur Errorbars dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!