Scilab Home page | Wiki | Bug tracker | Forge | Mailing list archives | ATOMS | File exchange
Please login or create an account
Change language to: English - Français - Português - 日本語
Справка Scilab >> Sparse Matrix > Sparse Matrix Manipulation > spones

spones

sparse matrix

Syntax

sp=spones(A)

Arguments

A

sparse matrix

sp

sparse matrix

Description

sp=spones(A) generates a matrix with the same sparsity structure as A, but with ones in the nonzero positions.

Examples

A=sprand(10,12,0.1);
sp=spones(A)
B = A~=0
bool2s(B)

See Also

  • sparse — sparse matrix definition
  • full — sparse to full matrix conversion
  • eye — единичная матрица
  • speye — sparse identity matrix
  • spzeros — sparse zero matrix
Scilab Enterprises
Copyright (c) 2011-2015 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Wed Jun 15 08:48:32 CEST 2016