Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

equivalent of Matlab "spy" command

426 views
Skip to first unread message

Yann Hervé De Roeck

unread,
Sep 28, 1999, 3:00:00 AM9/28/99
to
Matlab spy command displays the pattern of sparse matrices.
Is there any equivalent in Scilab ?

Thank you all in advance,

Yann-Hervé De Roeck.

Yann-Herve.De_Roeck.vcf

Matthieu Philippe

unread,
Sep 29, 1999, 3:00:00 AM9/29/99
to

Try this function made by S. STEER

function spy(S)
[nargout,nargin] = argn(0)
//SPY Visualize sparsity pattern.
// SPY(S) plots the sparsity pattern of the matrix S.
// S. STEER

if S==[] then S=0,end
[m,n] = size(S);
stx=max(1,10^(int(log10(m))))

rect=[0 0 m+1 n+1]

[i,j] = find(S);i = i(:);j = j(:);

xbasc();plot2d(0,0,-1,'051',' ',rect,[1 m+1,1 n+1])

plot2d(j,i,-1,'000')
xtitle('nz = '+string(nnz(S)),' ',' ');

Hope that helps
Scilab Jr

--
========================================================================
Matthieu PHILIPPE
SAPHIR CONTROL SARL
& Scilab Group (INRIA)
C/O INRIA-Rocquencourt Phones : + 33 (0) 1 39 63 59 23
Domaine de Voluceau B.P. 105 Fax : (0) 1 39 63 57 86
78153 Le Chesnay Cedex mailto:matthieu...@inria.fr
========================================================================

0 new messages