Documentation Center

  • Trial Software
  • Product Updates

rownames (DataMatrix)

Retrieve or set row names of DataMatrix object

Syntax

ReturnRowNames = rownames(DMObj)
ReturnRowNames = rownames(DMObj, RowIndices)
DMObjNew = rownames(DMObj, RowIndices, RowNames)

Input Arguments

DMObj

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

RowIndices

One or more rows in DMObj, specified by any of the following:

  • Positive integer

  • Vector of positive integers

  • String specifying a row name

  • Cell array of strings

  • Logical vector

RowNames

Row names specified by any of the following:

  • Numeric vector

  • Cell array of strings

  • Character array

  • Single string, which is used as a prefix for row names, with row numbers appended to the prefix

  • Logical true or false (default). If true, unique row names are assigned using the format row1, row2, row3, etc. If false, no row names are assigned.

    Note:   The number of elements in RowNames must equal the number of elements in RowIndices.

Output Arguments

ReturnRowNamesString or cell array of strings containing row names in DMObj.
DMObjNew

DataMatrix object created with names specified by RowIndices and RowNames.

Description

ReturnRowNames = rownames(DMObj) returns ReturnRowNames, a cell array of strings specifying the row names in DMObj, a DataMatrix object.

ReturnRowNames = rownames(DMObj, RowIndices) returns the row names specified by RowIndices. RowIndices can be a positive integer, vector of positive integers, string specifying a row name, cell array of strings, or a logical vector.

DMObjNew = rownames(DMObj, RowIndices, RowNames) returns DMObjNew, a DataMatrix object with rows specified by RowIndices set to the names specified by RowNames. The number of elements in RowIndices must equal the number of elements in RowNames.

See Also

|

Was this topic helpful?