This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


Redistribute codistributed array with another distribution scheme


D2 = redistribute(D1,codist)


D2 = redistribute(D1,codist) redistributes a codistributed array D1 and returns D2 using the distribution scheme defined by the codistributor object codist.


Redistribute an array according to the distribution scheme of another array.

  % First, create a magic square distributed by columns:
    M = codistributed(magic(10),codistributor1d(2,[1 2 3 4]));

  % Create a pascal matrix distributed by rows (first dimension):
    P = codistributed(pascal(10),codistributor1d(1));

  % Redistribute the pascal matrix according to the 
  % distribution (partition) scheme of the magic square:
    R = redistribute(P,getCodistributor(M));

Introduced in R2006b