Products & Services Industries Academia Support User Community Company

Learn more about Bioinformatics Toolbox   

mean (DataMatrix) - Return average or mean values in DataMatrix object

Syntax

M = mean(DMObj)
M = mean(DMObj, Dim)
M = mean(DMObj, Dim, IgnoreNaN)

Arguments

DMObj

DataMatrix object, such as created by DataMatrix (object constructor).

Dim

Scalar specifying the dimension of DMObj to calculate the means. Choices are:

  • 1 — Default. Returns mean values for elements in each column.

  • 2 — Returns mean values for elements in each row.

IgnoreNaN

Specifies if NaNs should be ignored. Choices are true (default) or false.

Return Values

M

Either of the following:

  • Row vector containing the mean values from elements in each column in DMObj (when Dim = 1)

  • Column vector containing the mean values from elements in each row in DMObj (when Dim = 2)

Description

M = mean(DMObj) returns the mean values of the elements in the columns of a DataMatrix object, treating NaNs as missing values. M is a row vector containing the mean values for elements in each column in DMObj.

M = mean(DMObj, Dim) returns the mean values of the elements in the columns or rows of a DataMatrix object, as specified by Dim. If Dim = 1, returns M, a row vector containing the mean values for elements in each column in DMObj. If Dim = 2, returns M, a column vector containing the mean values for elements in each row in DMObj. Default Dim = 1.

M = mean(DMObj, Dim, IgnoreNaN) specifies if NaNs should be ignored. IgnoreNaN can be true (default) or false.

See Also

Bioinformatics Toolbox function: DataMatrix (object constructor)

Bioinformatics Toolbox object: DataMatrix object

Bioinformatics Toolbox methods of a DataMatrix object: max, median, min, sum

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS