MATLAB Answers

How to display mean and standard deviation for some values in table?

19 views (last 30 days)
arthurk
arthurk on 28 Dec 2019
Answered: Walter Roberson on 28 Dec 2019
I have a table imported into Matlab.
Capture2.PNG
The y column is first, then x.
I want the standard deviation and mean of the y values corresponding only to the x values that are the same. for example, the standard deviation and mean of the first column until line 16, because that is when the value changes in the second column. Then display them onto errors bars.
Capture3.PNGThe graph outputs this, but I want to add errors bars indicating one standard deviation and the mean.

  0 Comments

Sign in to comment.

Answers (1)

Walter Roberson
Walter Roberson on 28 Dec 2019
See findgroups() and grpstats()
Note: in the terminology of MATLAB, you have an array rather than a table: if you had a table() object then the variable names would have been shown instead of column numbers.

  0 Comments

Sign in to comment.

Sign in to answer this question.