Main Content

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

DMObjDataMatrix object, such as created by DataMatrix (object constructor).
PropertyNameProperty name of a DataMatrix object.
PropertyValueValue of the property specified by PropertyName.

Description

set(DMObj) displays possible values for all properties that have a fixed set of property values in DMObj, a DataMatrix object.

set(DMObj, 'PropertyName') displays possible values for a specific property that has a fixed set of property values in DMObj, a DataMatrix object.

DMObj = set(DMObj, 'PropertyName', PropertyValue) sets the specified property of DMObj, a DataMatrix object.

DMObj = set(DMObj, 'Property1Name', Property1Value, 'Property2Name', Property2Value, ...) sets the specified properties of DMObj, a DataMatrix object.

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

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

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

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

Character vector that specifies the class type, such as single or double.

Note

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

Examples

  1. 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 in yeastvalues, and times, a vector of time values for labeling the columns in yeastvalues.

    load filteredyeastdata
    
  2. Import the microarray object package so that the DataMatrix constructor function will be available.

    import bioma.data.*
    
  3. Create a DataMatrix object from the gene expression data in the first 30 rows of the yeastvalues matrix.

    dmo = DataMatrix(yeastvalues(1:30,:));
    
  4. 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 and ColNames fields are empty.

  5. Use the set method and the genes and times variables to specify row names and column names for the DataMatrix object, dmo.

    dmo = set(dmo,'RowNames',genes(1:30),'ColNames',times)
  6. 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

See Also

|