Products & Services Solutions Academia Support User Community Company

Learn more about MATLAB   

spy - Visualize sparsity pattern

Syntax

spy(S)
spy(S,markersize)
spy(S,'LineSpec')
spy(S,'LineSpec',markersize)

Description

plots the

spy(S) sparsity pattern of any matrix S.

spy(S,markersize), where markersize is an integer, plots the sparsity pattern using markers of the specified point size.

spy(S,'LineSpec'), where LineSpec is a string, uses the specified plot marker type and color.

spy(S,'LineSpec',markersize) uses the specified type, color, and size for the plot markers.

S is usually a sparse matrix, but full matrices are acceptable, in which case the locations of the nonzero elements are plotted.

Examples

This example plots the 60-by-60 sparse adjacency matrix of the connectivity graph of the Buckminster Fuller geodesic dome. This matrix also represents the soccer ball and the carbon-60 molecule.

B = bucky;
spy(B)

See Also

find, gplot, LineSpec, symamd, symrcm

  


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