Mercurial > hg > octave-lyh
view scripts/sparse/spy.m @ 6498:2c85044aa63f
[project @ 2007-04-05 17:59:47 by jwe]
author | jwe |
---|---|
date | Thu, 05 Apr 2007 17:59:47 +0000 |
parents | f82f516c8a00 |
children | 2c19eaa2c6f7 |
line wrap: on
line source
## Copyright (C) 1998-2004 Andy Adler ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 2 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program; if not, write to the Free Software ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ## 02110-1301 USA ## -*- texinfo -*- ## @deftypefn {Function File} {} spy (@var{x}) ## Plot the sparsity pattern of the sparse matrix @var{x}. ## @end deftypefn function spy (S) if (issparse (S)) [i, j, s, m, n] = spfind (S); else [i, j, s] = find (S); [m, n] = size (S); endif if (numel (i) < 1000) plot (j, i, "*"); else plot (j, i, "."); endif axis ([0, n+1, 0, m+1]); endfunction