Errorbars with standard deviation

조회 수: 3 (최근 30일)
Michael Molini
Michael Molini 2019년 7월 3일
댓글: Peter Perkins 2019년 7월 8일
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
Adam Danz
Adam Danz 2019년 7월 8일
What is bedtime(:)? Is it a vector of date/times in datetime format? Is it part of a timetable?
I recommend organizing your data into a timetable and then using retime() to calculate means and standard deviations.
Peter Perkins
Peter Perkins 2019년 7월 8일
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.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Errorbars에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by