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 2025.0.0. This page might be outdated.
See the recommended documentation of this function

Scilabヘルプ >> Elementary Functions > Floating point > clean

clean

行列を消去 (小さなエントリをゼロに丸める)

呼び出し手順

B = clean(A)
B = clean(A, epsa)
B = clean(A, epsa, epsr)

引数

A

数値行列(スカラー, 多項式, 疎行列...)

epsa,epsr

実数. 消去の際の閾値 (デフォルト値はそれぞれ 10-10および10-10)

説明

この関数は, 多項式(もしくは多項式行列または有理行列)において 絶対値< epsaまたは 相対値< epsrの係数を全て消去(すなわち,ゼロに設定)します. (相対とは係数の1次ノルムに関する相対値を意味します)

(多項式でない)定数行列の場合,clean(A,epsa)epsaより小さなAのエントリを 全てゼロに設定します.

m = grand(3,5,"uin",1,9) .* 10.^grand(3,5,"uin",-16,1)
clean(m)
clean(m, 1e-7)
--> m = grand(3,5,"uin",1,9) .* 10.^grand(3,5,"uin",-16,1)
 m  =
   5.000D-08   5.          0.8         7.000D-08   4.000D-11
   0.00007     7.          4.000D-09   6.000D-13   2.000D-16
   2.000D-08   1.000D-14   1.          8.          0.7

--> clean(m)
 ans  =
   5.000D-08   5.   0.8         7.000D-08   0.
   0.00007     7.   4.000D-09   0.          0.
   2.000D-08   0.   1.          8.          0.7

--> clean(m, 1e-7)
 ans  =
   0.        5.   0.8   0.   0.
   0.00007   7.   0.    0.   0.
   0.        0.   1.    8.   0.7

For rationals:

x = poly(0,'x');
w = [3+2*x, 2+x; 3+x, 2-x]/5
r = w * inv(w)
clean(r)
--> w = [3+2*x, 2+x; 3+x, 2-x]/5
 w  =
   0.6 +0.4x   0.4 +0.2x
   0.6 +0.2x   0.4 -0.2x

--> r = w * inv(w)
 r  =
                                                                2
   -3.140D-16 + x                        -1.110D-15 + 3.331D-16x
   ---------------                       ------------------------
                                                           2
         x                                   1.3333333x + x
                                      2                             2
   1.110D-15 - 2.220D-16x - 5.551D-17x   -1.110D-15 + 1.3333333x + x
   ------------------------------------  ----------------------------
                           2                                 2
             1.3333333x + x                    1.3333333x + x

--> clean(r)
 ans  =
   1   0
   --  --
   1   1

   0   1
   --  --
   1   1

参照

  • %eps — イプシロン (浮動小数点数相対精度)
  • cond — 条件数
  • nearfloat — 前のまたは次の浮動小数点数を取得
  • number_properties — 浮動小数点数パラメータを定義する
Report an issue
<< ceil Floating point double >>

Copyright (c) 2022-2024 (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:06 CET 2019