| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Bioinformatics Toolbox |
| Contents | Index |
| Learn more about Bioinformatics Toolbox |
DMObjNew1 =
dmarrayfun(Func, DMObj1)
DMObjNew1 =
dmarrayfun(Func, DMObj1, DMObj2,
...)
[DMObjNew1, DMObjNew2,
...] = dmarrayfun(Func, DMObj1,
...)
[DMObjNew1, ...]
= dmarrayfun(Func, DMObj1,
...'UniformOutput', UniformOutputValue,
...)
[DMObjNew1, ...] = dmarrayfun(Func, DMObj1,
...'DataMatrixOutput', DataMatrixOutputValue,
...)
[DMObjNew1, ...] = dmarrayfun(Func, DMObj1,
...'Rows', RowsValue, ...)
[DMObjNew1, ...] = dmarrayfun(Func, DMObj1,
...'Columns', ColumnsValue, ...)
[DMObjNew1, ...] = dmarrayfun(Func, DMObj1,
...'ErrorHandler', ErrorHandlerValue, ...)
| Func | Function handle for a function that returns one or more scalars, and returns values of the same class each time it is called. |
| DMObj1 | DataMatrix object, such as created by DataMatrix (object constructor). |
| DMObj2 | Either of the following:
|
| UniformOutputValue | Specifies whether Func must return output values without encapsulation in a cell array. Choices are true (default) or false. If true, dmarrayfun must return scalar values that can be concatenated into an array. These values can also be a cell array. If false, dmarrayfun returns a cell array (or multiple cell arrays), where the I,Jth cell contains the value equal to Func(DMObj1(I,J),...). |
| DataMatrixOutputValue | Specifies whether return values must be DataMatrix objects. Choices are true (default) or false. If you set the 'UniformOutput' property to false, this property is ignored. |
| RowsValue, ColumnsValue | Specifies the rows or columns to which to apply the function. Choices are:
|
| ErrorHandlerValue | Specifies a function handle to a function that dmarrayfun calls if the call to Func fails. |
| DMObjNew1, DMObjNew2 | DataMatrix objects created from applying the function to each element in one or more DataMatrix objects. The size (number of rows and columns), row names, and column names will be the same as DMObj1. |
DMObjNew1 = dmarrayfun(Func, DMObj1) applies the function specified by Func to each element in DMObj1, a DataMatrix object, and returns the results in DMObjNew1, a new DataMatrix object. DMObjNew1 has the same size (number of rows and columns), row names, and column names as DMObj1. The I,Jth element of DMObjNew1 is equal to Func(DMObj1(I,J)), where Func is a function handle for a function that takes one input argument, returns one scalar value, and returns values of the same class each time it is called.
DMObjNew1 = dmarrayfun(Func, DMObj1, DMObj2, ...) evaluates the function specified by Func using elements in DMObj1, DMObj2, etc. as input arguments. The I,Jth element of DMObjNew1 is equal to Func(DMObj1(I,J), DMObj2(I,J), ...), where Func is a function handle for a function that takes multiple input arguments, returns one scalar, and returns values of the same class each time it is called.
[DMObjNew1, DMObjNew2, ...] = dmarrayfun(Func, DMObj1, ...) evaluates the function specified by Func using elements in DMObj1, and possibly other input arguments. Func is a function handle for a function that takes one or more input arguments, returns multiple scalars, and returns values of the same class each time it is called. It returns DataMatrix objects DMObjNew1, DMObjNew2, etc. with each one corresponding to one of the outputs of Func. The outputs of Func may be of different classes, however, but each output must be the same each time it is called.
[DMObjNew1, ...] = dmarrayfun(Func, DMObj1, ...'PropertyName', PropertyValue, ...) calls dmarrayfun with optional properties that use property name/property value pairs. You can specify one or more properties in any order. Each PropertyName must be enclosed in single quotation marks and is case insensitive. These property name/property value pairs are as follows:
[DMObjNew1, ...]
= dmarrayfun(Func, DMObj1,
...'UniformOutput', UniformOutputValue,
...) specifies whether Func must
return output values without encapsulation in a cell array. Choices
are true (default) or false.
If true, dmarrayfun must return
scalar values that can be concatenated into an array. These values
can also be a cell array. If false, dmarrayfun returns
a cell array (or multiple cell arrays), where the I,Jth
cell contains the value equal to Func(DMObj1(I,J),...).
[DMObjNew1, ...] = dmarrayfun(Func, DMObj1, ...'DataMatrixOutput', DataMatrixOutputValue, ...) specifies whether return values must be DataMatrix objects. Choices are true (default) or false. If you set the 'UniformOutput' property to false, this property is ignored.
[DMObjNew1, ...] = dmarrayfun(Func, DMObj1, ...'Rows', RowsValue, ...) applies the function only to the rows in the DataMatrix object specified by RowsValue, which can be a positive integer, vector of positive integers, string specifying a row name, cell array of strings, or a logical vector.
[DMObjNew1, ...] = dmarrayfun(Func, DMObj1, ...'Columns', ColumnsValue, ...) applies the function only to the columns in the DataMatrix object specified by ColsValue, which can be a positive integer, vector of positive integers, string specifying a column name, cell array of strings, or a logical vector.
[DMObjNew1, ...] = dmarrayfun(Func, DMObj1, ...'ErrorHandler', ErrorHandlerValue, ...) specifies a function handle to a function that dmarrayfun calls if the call to Func fails. The error handling function will be called with these input arguments:
Structure with the following fields:
identifier — Identifier of the error
message — Error message text
index — Linear index into the input array(s) at which the error occurred
Set of input arguments at which the call to the function failed
If you do not specify ErrorHandlerValue, dmarrayfun rethrows the error from the call to Func.
Bioinformatics Toolbox function: DataMatrix (object constructor)
Bioinformatics Toolbox object: DataMatrix object
Bioinformatics Toolbox method of a DataMatrix object: dmbsxfun
MATLAB function: arrayfun
![]() | disp (DataMatrix) | dmbsxfun (DataMatrix) | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |