Products & Services Solutions Academia Support User Community Company

Learn more about Parallel Computing Toolbox   

codistributed.colon - Distributed colon operation

Syntax

codistributed.colon(a,d,b)
codistributed.colon(a,b)

Description

codistributed.colon(a,d,b) partitions the vector a:d:b into numlabs contiguous subvectors of equal, or nearly equal length, and creates a codistributed array whose local portion on each lab is the labindex-th subvector.

codistributed.colon(a,b) uses d = 1.

Optional arguments to codistributed.colon must be specified after the required arguments, and in the following order:

Examples

Partition the vector 1:10 into four subvectors among four labs.

spmd(4); C = codistributed.colon(1,10), end
Lab 1: 
  This lab stores C(1:3).
          LocalPart: [1 2 3]
      Codistributor: [1x1 codistributor1d]
Lab 2: 
  This lab stores C(4:6).
          LocalPart: [4 5 6]
      Codistributor: [1x1 codistributor1d]
Lab 3: 
  This lab stores C(7:8).
          LocalPart: [7 8]
      Codistributor: [1x1 codistributor1d]
Lab 4: 
  This lab stores C(9:10).
          LocalPart: [9 10]
      Codistributor: [1x1 codistributor1d]

See Also

colon MATLAB function reference page

codistributor1d, codistributor2dbc, for

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS