Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
6.0.2 - 日本語

Change language to:
English - Français - Português - Русский

Please note that the recommended version of Scilab is 2024.0.0. This page might be outdated.
See the recommended documentation of this function

Scilabヘルプ >> Sparses Matrix > Sparse Matrix Manipulation > issparse

issparse

入力値が疎行列かどうかを調べる (numeric or boolean)

呼び出し手順

res = issparse(S)

引数

S

scilabオブジェクト

res

%T: 行列は疎行列, %F: その他

説明

res = issparse(S) は、S が疎行列の時に %T, それ以外の時に %F を返します.

sp = sprand(10, 20, 0.1);
if issparse(sp) then
   mprintf("Number of non-zero components: %d", nnz(sp));
end

A = %pi;
if ~issparse(A) then
    disp("A is not a sparse matrix");
end

spb = sp~=0 & sp < 0.5;
issparse(spb)
nnz(spb)

参照

  • isreal — 変数が実数または複素数のエントリかどうかを調べるc
  • sparse — 疎行列を定義
  • type — 変数の型を返す
  • typeof — explicit type or overloading code of an object

履歴

バージョン記述
6.0.2
  • issparse() now returns a boolean %T or %F instead of 1 or 0.
  • issparse() is now true as well for sparse booleans.
Report an issue
<< Sparse Matrix Manipulation Sparse Matrix Manipulation nnz >>

Copyright (c) 2022-2023 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Thu Feb 14 15:02:13 CET 2019