| Bioinformatics Toolbox™ | ![]() |
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.
Properties of a DataMatrix Object
| Property | Description | |
|---|---|---|
| Name | String that describes the DataMatrix object. Default is ''. | |
| RowNames | Empty array or cell array of strings 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 strings 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.
| |
| NCols | Read-only. Positive number that specifies the number of columns in the matrix.
| |
| NDims | Read-only. Positive number that specifies the number of dimensions in the matrix.
| |
| ElementClass | Read-only. String that specifies the class type of the elements in the DataMatrix object, such as single or double.
|
General Methods of a DataMatrix Object
| Method | Description |
|---|---|
| colnames | Retrieve or set column names of DataMatrix object. |
| disp | Display DataMatrix object. |
| display | Display DataMatrix object, printing DataMatrix object name. To invoke this method, enter the name of a DataMatrix object at the command prompt. |
| double | Convert DataMatrix object to double-precision array. |
| get | Retrieve information about DataMatrix object. |
| isempty | Determine if DataMatrix object is empty. |
| isfinite | Determine if DataMatrix object elements are finite. |
| isinf | Determine if DataMatrix object elements are infinite. |
| isnan | Determine if DataMatrix object elements are NaN. |
| isscalar | Determine if DataMatrix object is scalar. |
| isequal | Test DataMatrix objects for equality. |
| isequalwithequalnans | Test DataMatrix objects for equality, treating NaNs as equal. |
| isvector | Determine if DataMatrix object is vector. |
| length | Return length of DataMatrix object. |
| ndims | Return number of dimensions in DataMatrix object. |
| numel | Return number of elements in DataMatrix object. |
| plot | Draw 2-D line plot of DataMatrix object. |
| rownames | Retrieve or set row names of DataMatrix object. |
| set | Set property of DataMatrix object. |
| single | Convert DataMatrix object to single-precision array. |
| size | Return size of DataMatrix object. |
Methods for Manipulating the Data in a DataMatrix Object
| Method | Description |
|---|---|
| cat | Concatenate DataMatrix objects. The horzcat and vertcat methods implement special cases. |
| horzcat | Concatenate DataMatrix objects horizontally. |
| sortcols | Sort columns of DataMatrix object in ascending or descending order. |
| sortrows | Sort rows of DataMatrix object in ascending or descending order. |
| subsasgn | Subscripted assignment for DataMatrix object. To invoke this method, use parentheses or dot indexing described in Accessing DataMatrix Objects in the Bioinformatics Toolbox User's Guide. |
| subsref | Subscripted reference for DataMatrix object. To invoke this method, use parentheses or dot indexing described in Accessing DataMatrix Objects in the Bioinformatics Toolbox User's Guide. |
| transpose | Transpose DataMatrix object. |
| vertcat | Concatenate DataMatrix objects vertically. |
Descriptive Statistics and Statistical Learning Methods
| Method | Description |
|---|---|
| kmeans | K-means clustering. |
| max | Return maximum values in DataMatrix object. |
| mean | Return average or mean values in DataMatrix object. |
| median | Return median values in DataMatrix object. |
| min | Return minimum values in DataMatrix object. |
| nanmax | Return maximum values in DataMatrix object ignoring NaN values. |
| nanmean | Return average or mean values in DataMatrix object ignoring NaN values. |
| nanmedian | Return median values in DataMatrix object ignoring NaN values. |
| nanmin | Return minimum values in DataMatrix object ignoring NaN values. |
| nanstd | Return standard deviation values in DataMatrix object ignoring NaN values. |
| nansum | Return sum of elements in DataMatrix object ignoring NaN values. |
| nanvar | Return variance values in DataMatrix object ignoring NaN values. |
| pdist | Pairwise distance. |
| princomp | Principal component analysis on data. |
| std | Return standard deviation values in DataMatrix object. |
| sum | Return sum of elements in DataMatrix object. |
| var | Return variance values in DataMatrix object. |
Unary Methods — Exponential
| Method | Description |
|---|---|
| exp | Exponential. |
| log | Natural logarithm. |
| log10 | Common (base 10) logarithm. |
| log2 | Base 2 logarithm and dissect floating-point numbers into exponent and mantissa. |
| pow2 | Base 2 power and scale floating-point numbers. |
| sqrt | Square root. |
Unary Methods — Integer
| Method | Description |
|---|---|
| ceil | Round DataMatrix object toward infinity. |
| fix | Round DataMatrix object toward zero. |
| floor | Round DataMatrix object toward minus infinity. |
| round | Round DataMatrix object to nearest integer. |
Unary Methods — Custom
| Method | Description |
|---|---|
| dmarrayfun | Apply function to each element in DataMatrix object. |
Binary Methods — Arithmetic Operator
| Operator | Method | Description |
|---|---|---|
| + | plus | Add DataMatrix objects |
| - | minus | Subtract DataMatrix objects. |
| .* | times | Multiply DataMatrix objects. |
| ./ | rdivide | Right array divide DataMatrix objects. |
| .\ | ldivide | Left array divide DataMatrix objects. |
| .^ | power | Array power DataMatrix objects. |
Binary Methods — Relational Operator
| Operator | Method | Description |
|---|---|---|
| < | lt | Test DataMatrix objects for less than. |
| <= | le | Test DataMatrix objects for less than or equal to. |
| > | gt | Test DataMatrix objects for greater than. |
| >= | ge | Test DataMatrix objects for greater than or equal to. |
| == | eq | Test DataMatrix objects for equality. |
| ~= | ne | Test DataMatrix objects for inequality. |
Binary Methods — Custom
| Method | Description |
|---|---|
| dmbsxfun | Apply element-by-element binary operation to two DataMatrix objects with singleton expansion enabled. |
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', ...)
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')
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 Working with DataMatrix Objects in the Bioinformatics Toolbox User's Guide. |
Bioinformatics Toolbox function: DataMatrix (object constructor)
Bioinformatics Toolbox methods of a DataMatrix object: colnames, disp, dmarrayfun, dmbsxfun, double, eq, ge, get, gt, horzcat, isequal, isequalwithequalnans, ldivide, le, lt, max, mean, median, min, minus, ndims, ne, numel, plot, plus, power, rdivide, rownames, set, single, sortcols, sortrows, std, sum, times, var, vertcat
![]() | clustergram object | geneont object | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |