Products & Services Solutions Academia Support User Community Company

Learn more about Parallel Computing Toolbox   

distributed.spalloc - Allocate space for sparse distributed matrix

Syntax

SD = distributed.spalloc(M, N, nzmax)

Description

SD = distributed.spalloc(M, N, nzmax) creates an M-by-N all-zero sparse distributed matrix with room to hold nzmax nonzeros.

Examples

Allocate space for a 1000-by-1000 sparse distributed matrix with room for up to 2000 nonzero elements, then define several elements:

N = 1000;
SD = distributed.spalloc(N, N, 2*N);
for ii=1:N-1
    SD(ii,ii:ii+1) = [ii ii];
end

See Also

spalloc MATLAB function reference page

codistributed.spalloc, sparse

  


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