Main Content


Access elements of distributed arrays from client



You can also create a distributed object using some MATLAB® functions by specifying a distributed output. The following table lists the available MATLAB functions that can create distributed objects directly. For more information, see the Extended Capabilities section of the function reference page.



Distributed arrays represent those arrays which are partitioned out among the workers in a parallel pool. A distributed array resembles a normal MATLAB array in the way you index and manipulate its elements, but none of its elements exists on the client.

Codistributed arrays that you create inside spmd statements are accessible as distributed arrays from the client.

Use the gather function to retrieve distributed arrays into the client work space.


classUnderlying(Not recommended) Class of elements within gpuArray or distributed array
distributed.cellCreate distributed cell array
distributed.spallocAllocate space for sparse distributed matrix
distributed.speyeCreate distributed sparse identity matrix
distributed.sprandCreate distributed sparse array of uniformly distributed pseudo-random values
distributed.sprandnCreate distributed sparse array of normally distributed pseudo-random values
gatherTransfer distributed array, Composite array or gpuArray to local workspace
isaUnderlying(Not recommended) True if distributed array's underlying elements are of specified class
isdistributedTrue for distributed array
writeWrite distributed data to an output location

The methods for distributed arrays are too numerous to list here. Most resemble and behave the same as built-in MATLAB functions. See Run MATLAB Functions with Distributed Arrays.

Also among the methods are several for examining the characteristics of the array itself. Most behave like the MATLAB functions of the same name:

isdistributedIndication if array is distributed
isrealIndication if array elements are real
isUnderlyingTypeDetermine if underlying data in the array is of specified type
lengthLength of vector or largest array dimension
ndimsNumber of dimensions in the array
sizeSize of array dimensions
underlyingTypeClass (data type) of the underlying data in the array

Version History

Introduced in R2008a