User`s guide

eye
11-83
D = eye(1000,'distributed');
Create Codistributed Identity Matrix
Create a 1000-by-1000 codistributed double identity matrix, distributed by its second
dimension (columns).
spmd(4)
C = eye(1000,'codistributed');
end
With four workers, each worker contains a 1000-by-250 local piece of C.
Create a 1000-by-1000 codistributed uint16 identity matrix , distributed by its columns.
spmd(4)
codist = codistributor('1d',2,100*[1:numlabs]);
C = eye(1000,1000,'uint16',codist);
end
Each worker contains a 100-by-labindex local piece of C.
Create gpuArray Identity Matrix
Create a 1000-by-1000 gpuArray identity matrix of underlying class uint32:
G = eye(1000,'uint32','gpuArray');
See Also
codistributed.speye | distributed.speye | eye | false | Inf | NaN | ones |
true | zeros