FUNCTION REFERENCE

sprandsym

Random symmetric sparse matrix.

Random symmetric sparse matrix.

Syntax

S = sprandsym(n, density)

Draws the lower triangle with normal values and mirrors it across the diagonal.

Example

S = sprandsym(5, 0.4); norm(full(S-S.'))

Differences from MATLAB: Positions are drawn first and values second; the density controls draws in the lower triangle.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.