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ヘルプ >> Scilab > Scilab keywords > minus

minus

(-) 減算演算子, 符号変更

呼び出し手順

X - Y
-Y

引数

X, Y

数値,多項式または有理数のスカラーまたはベクトルまたは行列. syslinリストを指定することも可能です.

説明

減算

数値オペランドの場合,一般的な意味と同じく減算を意味します. オペランドの一つが行列でもう一つがスカラーの場合, 演算子は要素毎に適用されます. Y==[]の場合, Xが返され, X==[]の場合, -Yが返されます.

As soon as a boolean is involved in a substraction with a number (decimal, complex, or encoded integer), it is automatically converted in the type (and integer type) of the number before performing the substraction or the sign change, as %F => 0 and %T => 1.

Whatever is the (regular) type of X, then []-X, X-[], and -[] return [].

減算は,"ソフトコードされた"演算により他のデータ型についても 定義できます (オーバーローディング参照).

[] - 2
1 - []
[2, 5] - 1
[2, 5] - [3 -2]

%s - 2
1/%s - 2
--> [] - 2
 ans  =
    []

--> 1 - []
 ans  =
    []

--> [2, 5] - 1
 ans  =
   1.   4.

--> [2, 5] - [3 -2]
 ans  =
  -1.   7.

--> %s - 2
 ans  =
  -2 +s

--> 1/%s - 2
 ans  =
   1 - 2s
   -------
     s

With booleans:

-[%f %t]
[%f %f %t %t]  - [%f %t %f %t]
%t - %i
c = %t - int8(7), inttype(c)
--> -[%f %t]
 ans  =
   0.  -1.

--> [%f %f %t %t]  - [%f %t %f %t]
 ans  =
   0.  -1.   1.   0.

--> %t - %i
 ans  =
   1. - i

--> c = %t - int8(7), typeof(c)
 c  =
 -6

 ans  =
 int8

参照

  • plus — 数値の加算。 テキストの連結(グループ化)
  • operators — scilab 演算子の名前
  • overloading — 表示,関数および演算子オーバーロード機能
  • oldEmptyBehaviour — Controls the operation+ and operation- behaviour for Scilab
  • mtlb_s — Matlab subtraction emulation function

履歴

バージョン記述
6.0.0 A - [] and [] - A now return [] instead of A or -A.
Report an issue
<< less Scilab keywords not >>

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:01:59 CET 2019