redistribute
使用另一种分布方案重新分配共存分布式数组
语法
D2 = redistribute(D1,codist)
说明
D2 = redistribute(D1,codist)
重新分配一个共存分布式数组 D1
,并使用 codistributor
对象 D2
定义的分布方案返回 codist
。
示例
根据另一个数组的分布方案重新分配一个数组。
spmd % 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)); end
版本历史记录
在 R2006b 中推出