主要内容

double

Convert DataMatrix object to double-precision array

Description

B = double(DMObj) converts DMObj, a DataMatrix object, to a double-precision array, which it returns in B.

example

B = double(DMObj, Rows) converts a subset of DMObj, a DataMatrix object, specified by Rows, to a double-precision array, which it returns inB.

example

B = double(DMObj, Rows, Cols) converts a subset of DMObj, a DataMatrix object, specified by Rows and Cols, to a double-precision array, which it returns inB.

example

Examples

collapse all

Create a DataMatrix object.

S = single([2.345,3.897;4.0123,5.436;6.129,7.341]);
dm = bioma.data.DataMatrix(S);

Convert the first row to double.

B = double(dm,1)
B = 1×2

    2.3450    3.8970

Convert a subset of DataMatrix to double.

B = double(dm,[1,2],[1,2])
B = 2×2

    2.3450    3.8970
    4.0123    5.4360

Convert the whole DataMatrix to double.

B = double(dm)
B = 3×2

    2.3450    3.8970
    4.0123    5.4360
    6.1290    7.3410

class(B)
ans = 
'double'

Input Arguments

collapse all

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

Rows of DataMatrix, specified as a positive integer, vector of positive integers, character vector, string scalar, string vector, or cell array of character vectors specifying a row name or row names, or a logical vector.

Columns of DataMatrix, specified as a positive integer, vector of positive integers, character vector, string scalar, string vector, or cell array of character vectors specifying a column name or column names, or a logical vector.

Output Arguments

collapse all

Numeric output, returned as a numeric array.

Data Types: single | double

Version History

Introduced in R2008b

See Also

|