Sort data, plot means, std errors

Given a matrix with y, x and z columns, plot graphs of y vs x for each z, with error bars.

您现在正在关注此提交

Syntax: [curvestructarray, relevant_data] = meansemfun(datasource, xcolindex, ycolindex, zparamcolindex)

Given a data matrix (datasource) with columns for y, x and (optionally) z, sort the data and create a graph showing y vs x for each z, with error bars.

In the data matrix each row typically represents an observation, with columns for the independent (x axis) and dependent (y) variables. The second independent variable (z), if present, is used for distinguishing among different curves to be plotted. There can be any number of rows, with x and z (curve-parameter) values recurring in any order and with any frequency. The x values can be different for the different curves.

All arguments are optional. If no arguments are supplied, the user is asked to specify a file source for the data, by entering the name of a text file that contains the data matrix. Arguments 2:4 are the column indices for x, y, and (optionally) the curve parameter z; if these are missing, meansemfun asks the user to input them.

Meansemfun plots the mean and +-1 times the s.e.m. of y, versus x, for each value of the curve parameter z. It returns curvestructarray, an array of structures, one for each curve. Fields are X; mean of Y; standard error of the mean of Y; and number of observations, each as a column vectors ordered in ascending order of X; and the (scalar) curve parameter value z, if applicable. Also returned are the relevant data, suitably sorted.

引用格式

Don MacLeod (2026). Sort data, plot means, std errors (https://ww2.mathworks.cn/matlabcentral/fileexchange/20181-sort-data-plot-means-std-errors), MATLAB Central File Exchange. 检索时间: .

类别

Help CenterMATLAB Answers 中查找有关 Shifting and Sorting Matrices 的更多信息

一般信息

MATLAB 版本兼容性

  • 兼容任何版本

平台兼容性

  • Windows
  • macOS
  • Linux
版本 已发布 发行说明 Action
1.1.0.0

comments

1.0.0.0

Fixed bug in plot color selection