Main Content

isdlarray

Determine whether input is dlarray

    Description

    example

    TF = isdlarray(X) returns logical 1 (true) if X is a dlarray, and logical 0 (false) otherwise. You can use this function with an if statement to avoid executing code that expects dlarray input.

    Examples

    collapse all

    Create an array of random numbers.

    X = rand(3,3);

    Create a dlarray from X.

    dlX = dlarray(X);

    Use the function isdlarray to verify that dlX is a dlarray

    isdlarray(dlX)
    ans = 
       1
    

    Verify that X is not a dlarray

    isdlarray(X)
    ans = 
       0
    

    Input Arguments

    collapse all

    Input variable, specified as a workspace variable. X can be any data type.

    Extended Capabilities

    Introduced in R2020b