dlarray
Determine whether input is dlarray
TF = isdlarray(X)
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.
TF
X
1
true
0
false
if
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
isdlarray(dlX)
ans = 1
Verify that X is not a dlarray
isdlarray(X)
ans = 0
Input variable, specified as a workspace variable. X can be any data type.
This function fully supports GPU arrays. For more information, see Run MATLAB Functions on a GPU (Parallel Computing Toolbox).
dlarray | extractdata
extractdata