Main Content

extractdata

Extract data from dlarray object

Description

The extractdata function extracts the data from a dlarray object.

Y = extractdata(X) returns the data in dlarray object X.

You can call extractdata on other data types, such as numeric arrays. If X is not a dlarray object, then the function has no effect. (since R2026a)

example

Examples

collapse all

Create a logical dlarray with data format 'SS'.

rng default % For reproducibility
dlX = dlarray(rand(4,3) > 0.5,'SS')
dlX = 
  4(S) × 3(S) logical dlarray

   1   1   1
   1   0   1
   0   0   0
   1   1   1

Extract the data from dlX.

y = extractdata(dlX)
y = 4×3 logical array

   1   1   1
   1   0   1
   0   0   0
   1   1   1

Input Arguments

collapse all

Input data, specified as a dlarray object.

Output Arguments

collapse all

Extracted data, returned as a single, double, or logical array, or as a gpuArray of one of these array types. The output Y has the same data type as the underlying data type in X.

If X is not a dlarray object, then Y is identical to X.

Tips

  • If X contains an implicit permutation because of formatting, Y has that permutation explicitly.

  • The output Y has no tracing for the computation of derivatives. See Derivative Trace.

Extended Capabilities

expand all

Version History

Introduced in R2019b

expand all

See Also

| (Parallel Computing Toolbox)