set
Set property of DataMatrix object
Syntax
set(
DMObj
)
set(DMObj
, 'PropertyName
')
DMObj
= set(DMObj
,
'PropertyName
', PropertyValue
)
DMObj
= set(DMObj
,
'Property1Name
', Property1Value
,
'Property2Name
', Property2Value
,
...)
Arguments
DMObj | DataMatrix object, such as created by DataMatrix (object
constructor). |
PropertyName | Property name of a DataMatrix object. |
PropertyValue | Value of the property specified by PropertyName . |
Description
set(
displays
possible values for all properties that have a fixed set of property
values in DMObj
)DMObj
, a DataMatrix object.
set(
displays
possible values for a specific property that has a fixed set of property
values in DMObj
, 'PropertyName
')DMObj
, a DataMatrix object.
sets
the specified property of DMObj
= set(DMObj
,
'PropertyName
', PropertyValue
)DMObj
, a DataMatrix
object.
sets the specified properties of DMObj
= set(DMObj
,
'Property1Name
', Property1Value
,
'Property2Name
', Property2Value
,
...)DMObj
,
a DataMatrix object.
Properties of a DataMatrix Object
Property | Description |
---|---|
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 | Positive number that specifies the number of rows in the matrix. Note You cannot modify this property directly. You can access it
using the |
NCols | Positive number that specifies the number of columns in the matrix. Note You cannot modify this property directly. You can access it
using the |
NDims | Positive number that specifies the number of dimensions in the matrix. Note You cannot modify this property directly. You can access it
using the |
ElementClass | Character vector that specifies
the class type, such as Note You cannot modify this property directly. You can access it
using the |
Examples
Load the MAT-file, provided with the Bioinformatics Toolbox™ software, that contains yeast data. This MAT-file includes three variables:
yeastvalues
, a matrix of gene expression data,genes
, a cell array of GenBank® accession numbers for labeling the rows inyeastvalues
, andtimes
, a vector of time values for labeling the columns inyeastvalues
.load filteredyeastdata
Import the microarray object package so that the
DataMatrix
constructor function will be available.import bioma.data.*
Create a DataMatrix object from the gene expression data in the first 30 rows of the
yeastvalues
matrix.dmo = DataMatrix(yeastvalues(1:30,:));
Use the
get
method to display the properties of the DataMatrix object,dmo
.get(dmo) Name: '' RowNames: [] ColNames: [] NRows: 30 NCols: 7 NDims: 2 ElementClass: 'double'
Notice that the
RowNames
andColNames
fields are empty.Use the
set
method and thegenes
andtimes
variables to specify row names and column names for the DataMatrix object,dmo
.dmo = set(dmo,'RowNames',genes(1:30),'ColNames',times)
Use the
get
method to display the properties of the DataMatrix object,dmo
.get(dmo) Name: '' RowNames: {30x1 cell} ColNames: {' 0' ' 9.5' '11.5' '13.5' '15.5' '18.5' '20.5'} NRows: 30 NCols: 7 NDims: 2 ElementClass: 'double'
Version History
Introduced in R2008b