Main Content

DataMatrix

Data structure encapsulating data and metadata from microarray experiment so that it can be indexed by gene or probe identifiers and by sample identifiers

Description

A DataMatrix object is a data structure encapsulating measurement data and feature metadata from a microarray experiment so that it can be indexed by gene or probe identifiers and by sample identifiers. A DataMatrix object stores experimental data in a matrix, with rows typically corresponding to gene names or probe identifiers, and columns typically corresponding to sample identifiers. A DataMatrix object also stores metadata, such as the gene names or probe identifiers and sample identifiers, in row names and column names.

You create a DataMatrix object using the object constructor function DataMatrix.

Property Summary

Properties of a DataMatrix Object

PropertyDescription
Name

Character vector that describes the DataMatrix object. Default is ''.

RowNames

Empty array or cell array of character vectors that specifies the names for the rows, typically gene names or probe identifiers. The number of elements in the cell array must equal the number of rows in the matrix. Default is an empty array.

ColNames

Empty array or cell array of character vectors that specifies the names for the columns, typically sample identifiers. The number of elements in the cell array must equal the number of columns in the matrix.

NRows

Read-only. Positive number that specifies the number of rows in the matrix.

Note

You cannot modify this property directly. You can access it using the get method.

NCols

Read-only. Positive number that specifies the number of columns in the matrix.

Note

You cannot modify this property directly. You can access it using the get method.

NDims

Read-only. Positive number that specifies the number of dimensions in the matrix.

Note

You cannot modify this property directly. You can access it using the get method.

ElementClass

Read-only. Character vector that specifies the class type of the elements in the DataMatrix object, such as single or double.

Note

You cannot modify this property directly. You can access it using the get method.

Method Summary

General Methods of a DataMatrix Object

MethodDescription
colnamesRetrieve or set column names of DataMatrix object.
dispDisplay DataMatrix object.
dmwriteWrite DataMatrix object to text file.
doubleConvert DataMatrix object to double-precision array.
getRetrieve information about DataMatrix object.
isemptyDetermine if DataMatrix object is empty.
isfiniteDetermine if DataMatrix object elements are finite.
isinfDetermine if DataMatrix object elements are infinite.
isnanDetermine if DataMatrix object elements are NaN.
isscalarDetermine if DataMatrix object is scalar.
isequalTest DataMatrix objects for equality.
isequalnTest DataMatrix objects for equality, treating NaNs as equal.
isvectorDetermine if DataMatrix object is vector.
lengthReturn length of DataMatrix object.
ndimsReturn number of dimensions in DataMatrix object.
numelReturn number of elements in DataMatrix object.
plotDraw 2-D line plot of DataMatrix object.
rownamesRetrieve or set row names of DataMatrix object.
setSet property of DataMatrix object.
singleConvert DataMatrix object to single-precision array.
sizeReturn size of DataMatrix object.

Methods for Manipulating the Data in a DataMatrix Object

MethodDescription
catConcatenate DataMatrix objects. The horzcat and vertcat methods implement special cases.
horzcatConcatenate DataMatrix objects horizontally.
sortcolsSort columns of DataMatrix object in ascending or descending order.
sortrowsSort rows of DataMatrix object in ascending or descending order.
subsasgnSubscripted assignment for DataMatrix object. To invoke this method, use parentheses or dot indexing described in Accessing Data in DataMatrix Objects.
subsrefSubscripted reference for DataMatrix object. To invoke this method, use parentheses or dot indexing described in Accessing Data in DataMatrix Objects.
transposeTranspose DataMatrix object.
vertcatConcatenate DataMatrix objects vertically.

Descriptive Statistics and Statistical Learning Methods

MethodDescription
kmeansK-means clustering.
maxReturn maximum values in DataMatrix object.
meanReturn average or mean values in DataMatrix object.
medianReturn median values in DataMatrix object.
minReturn minimum values in DataMatrix object.
nanmaxReturn maximum values in DataMatrix object ignoring NaN values.
nanmeanReturn average or mean values in DataMatrix object ignoring NaN values.
nanmedianReturn median values in DataMatrix object ignoring NaN values.
nanminReturn minimum values in DataMatrix object ignoring NaN values.
nanstdReturn standard deviation values in DataMatrix object ignoring NaN values.
nansumReturn sum of elements in DataMatrix object ignoring NaN values.
nanvarReturn variance values in DataMatrix object ignoring NaN values.
pcaPrincipal component analysis on data.
pdistPairwise distance.
stdReturn standard deviation values in DataMatrix object.
sumReturn sum of elements in DataMatrix object.
varReturn variance values in DataMatrix object.

Unary Methods — Exponential

MethodDescription
expExponential.
logNatural logarithm.
log10Common (base 10) logarithm.
log2Base 2 logarithm and dissect floating-point numbers into exponent and mantissa.
pow2Base 2 power and scale floating-point numbers.
sqrtSquare root.

Unary Methods — Integer

MethodDescription
ceilRound DataMatrix object toward infinity.
fixRound DataMatrix object toward zero.
floorRound DataMatrix object toward minus infinity.
roundRound DataMatrix object to nearest integer.

Unary Methods — Custom

MethodDescription
dmarrayfunApply function to each element in DataMatrix object.

Binary Methods — Arithmetic Operator

OperatorMethodDescription
+plusAdd DataMatrix objects
-minusSubtract DataMatrix objects.
.*timesMultiply DataMatrix objects.
./rdivideRight array divide DataMatrix objects.
.\ldivideLeft array divide DataMatrix objects.
.^powerArray power DataMatrix objects.

Binary Methods — Relational Operator

OperatorMethodDescription
<ltTest DataMatrix objects for less than.
<=leTest DataMatrix objects for less than or equal to.
>gtTest DataMatrix objects for greater than.
>=geTest DataMatrix objects for greater than or equal to.
==eqTest DataMatrix objects for equality.
~=neTest DataMatrix objects for inequality.

Binary Methods — Custom

MethodDescription
dmbsxfunApply element-by-element binary operation to two DataMatrix objects with singleton expansion enabled.

Examples

Example 3. Determining Properties and Property Values of a DataMatrix Object

You can display all properties and their current values of a DataMatrix object, DMobj, by using the following syntax:

get(DMobj)

You can return all properties and their current values of DMobj, a DataMatrix object, to DMstruct, a scalar structure in which each field name is a property of a DataMatrix object, and each field contains the value of that property, by using the following syntax:

DMstruct = get(DMobj)

You can return the value of a specific property of a DataMatrix object, DMobj, by using either of the following syntaxes:

PropertyValue = get(DMObj, 'PropertyName')
PropertyValue = DMObj.PropertyName

You can return the value of specific properties of a DataMatrix object, DMobj, by using the following syntax:

[Property1Value, Property2Value, ...] = get(DMobj, ...
'Property1Name', 'Property2Name', ...)
Example 4. Determining Possible Values of DataMatrix Object Properties

You can display possible values for all properties that have a fixed set of property values in a DataMatrix object, DMobj, by using the following syntax:

set(DMobj)

You can display possible values for a specific property that has a fixed set of property values in a DataMatrix object, DMobj, by using the following syntax:

set(DMObj,  'PropertyName')
Example 5. Specifying Properties of a DataMatrix Object

You can set a specific property of a DataMatrix object, DMObj, by using either of the following syntaxes:

DMObj = set(DMObj,  'PropertyName', PropertyValue)
DMObj.PropertyName = PropertyValue

You can set multiple properties of a DataMatrix object, DMobj, by using the following syntax:

set(DMobj,  'PropertyName1', PropertyValue1, ...
    'PropertyName2', PropertyValue2, ...)

Note

For more examples of creating and using DataMatrix objects, see Representing Expression Data Values in DataMatrix Objects.

Version History

Introduced in R2008b

expand all