Hauptinhalt

power, .^

Array power DataMatrix objects

Description

DMObjNew = power(DMObj1,DMObj2) performs an element-by-element power of the DataMatrix objects DMObj1 and DMObj2 and places the results in DMObjNew, another DataMatrix object. In other words, power raises each element in DMObj1 by the corresponding element in DMObj2.

example

DMObjNew = DMObj1 .^ DMObj2 is equivalent to DMObjNew = power(DMObj1,DMObj2).

example

DMObjNew = power(DMObj1,B) performs an element-by-element power of the DataMatrix object DMObj1 and B, a numeric or logical array, and places the results in DMObjNew, another DataMatrix object. In other words, power raises each element in DMObj1 by the corresponding element in B.

example

DMObjNew = DMObj1 .^ B is equivalent to DMObjNew = power(DMObj1,B).

example

DMObjNew = power(B,DMObj1) performs an element-by-element power of B, a numeric or logical array, and the DataMatrix object DMObj1, and places the results in DMObjNew, another DataMatrix object. In other words, power raises each element in B by the corresponding element in DMObj1.

example

DMObjNew = B .^ DMObj1 is equivalent to DMObjNew = power(B,DMObj1).

example

Examples

collapse all

Create DataMatrix objects.

dm1 = bioma.data.DataMatrix([2,3;4,5;6,7]);
dm2 = bioma.data.DataMatrix([1,2;2,3;4,5]);

Square each matrix.

dm1.^2
ans = 

         1     2 
    1     4     9
    2    16    25
    3    36    49
dm2.^2
ans = 

         1     2 
    1     1     4
    2     4     9
    3    16    25

Compute the element-by-element power of two DataMatrix objects.

dm3 = power(dm1,dm2)
dm3 = 

         1       2    
    1       2        9
    2      16      125
    3    1296    16807

Equivalently, you can do the following.

dm4 = dm1.^dm2
dm4 = 

         1       2    
    1       2        9
    2      16      125
    3    1296    16807

Input Arguments

collapse all

DataMatrix, specified as a bioma.data.DataMatrix object.

DMObj1 and DMObj2 must have the same size (number of rows and columns), unless one is a scalar (1-by-1 DataMatrix object). The size (number of rows and columns), row names, and column names for DMObjNew are the same as DMObj1, unless DMObj1 is a scalar; then they are the same as DMObj2.

DataMatrix, specified as a bioma.data.DataMatrix object.

DMObj1 and DMObj2 must have the same size (number of rows and columns), unless one is a scalar (1-by-1 DataMatrix object). The size (number of rows and columns), row names, and column names for DMObjNew are the same as DMObj1, unless DMObj1 is a scalar; then they are the same as DMObj2.

Numeric or logical input, specified as a numeric or logical array.

DMObj1 and B must have the same size (number of rows and columns), unless B is a scalar. The size (number of rows and columns), row names, and column names for DMObjNew are the same as DMObj1.

Data Types: double | logical

Note

Arithmetic operations between a scalar DataMatrix object and a nonscalar array are not supported.

Output Arguments

collapse all

DataMatrix after sorting the columns, returned as a bioma.data.DataMatrix object.

Version History

Introduced in R2008b

See Also

|