Scilab Home page | Wiki | Bug tracker | Forge | Mailing list archives | ATOMS | File exchange
Please login or create an account
Change language to: Français - Português - 日本語 - Русский
Scilab Help >> Scilab > Scilab keywords > minus

minus

(-) subtraction operator, sign changes

Syntax

X-Y
-Y

Arguments

X

scalar or vector or matrix of numbers, polynomials or rationals. It may also be a syslin list.

Y

scalar or vector or matrix of numbers, polynomials or rationals. It may also be a syslin list.

Description

Subtraction

For numeric operands subtraction as its usual meaning. If one of the operands is a matrix and the other one a scalar then the operation is performed element-wise. For X - Y, if Y == [] or Y == [] then [] is returned;

Subtraction may also be defined for other data types through "soft-coded" operations (see overloading).

Examples

[1,2]-1
[]-2

%s-2
1/%s-2

See also

  • mtlb_mode — switch Matlab like operations
  • plus — (+) addition operator
  • overloading — display, functions and operators overloading capabilities

History

VersionDescription
6.0.0 Modified the behaviour of A- [] and [] - A to return the empty matrix [] instead of A or -A
Scilab Enterprises
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Mon Feb 12 19:26:46 CET 2018