Main Content

extractdata

Extract data from dlarray

Since R2019b

Description

example

Y = extractdata(X) returns the data in the dlarray X. The output Y has the same data type as the underlying data in X.

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) x 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 = 4x3 logical array

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

Input Arguments

collapse all

Input dlarray, specified as a dlarray object.

Example: X = dlarray(randn(50,3),'SC')

Output Arguments

collapse all

Data array, 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.

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

Version History

Introduced in R2019b

See Also

| (Parallel Computing Toolbox)