## Documentation |

Apply element-by-element binary operation to two DataMatrix objects with singleton expansion enabled

* DMObjNew* =
dmbsxfun(

Func | Function handle for a function or a built-in function.
For more information on built-in functions, see |

, DMObj1DMObj2 | Either of the following: DataMatrix object, such as created by `DataMatrix`(object constructor)MATLAB ^{®}numeric array
At least one of these input arguments must be a DataMatrix object. |

DMObjNew | DataMatrix object or MATLAB numeric array created from element-by-element binary operation of two DataMatrix objects with singleton expansion enabled. |

`DMObjNew =
dmbsxfun(Func, DMObj1, DMObj2)` applies
an element-by-element binary operation to the DataMatrix objects

* DMObj1* and

* DMObjNew* is a DataMatrix object,
unless the larger input argument is a MATLAB numeric array; then

Use the

`DataMatrix`constructor function to create a DataMatrix object.A = bioma.data.DataMatrix(magic(3), 'RowNames', true, ... 'ColNames',true)

Use the built-in function

`@minus`to subtract the column means from this DataMatrix object.A = dmbsxfun(@minus, A, mean(A))

Was this topic helpful?