Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
6.1.0 - Português

Change language to:
English - Français - 日本語 - Русский

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

Ajuda do Scilab >> Scilab > Configuration > oldEmptyBehaviour

oldEmptyBehaviour

Controls the operation+ and operation- behaviour for Scilab

Syntax

oldEmptyBehaviour(behaviour)

Arguments

behaviour

a single string amongst "on", "off" or "query". The behaviour mode for operation+ and operation-

Description

Controls the behaviour of the empty matrix addition and subtraction. On versions prior to scilab-6.0.0, adding or subtracting and empty matrix to any other value val would return val.

If behaviour == "off", adding or subtracting the empty matrix will yield to the empty matrix. This is the default behaviour of scilab after version 6.0.0.

If behaviour == "on", activates the behaviour prior to scilab-6.0.0.

If behaviour == "query", returns the current value ("on" or "off") for the oldEmptyBehaviour tag.

Examples

// Get the current behaviour
behaviour = oldEmptyBehaviour("query");

// These will return empty
oldEmptyBehaviour("off");
1 + []
"Test string" + []
[] - int8(1)
[] - %s

// These will leave the other operand unchanged
oldEmptyBehaviour("on");
1 + [] // returns 1
"Test string" + [] // returns "Test string"
[] - int8(1) // returns int8(1)
[] - %s // returns %s

// Get back to the saved behaviour
oldEmptyBehaviour(behaviour)

See also

  • warning for the warning behaviour on operation+ and operation-
  • plus for the behaviour of the operation+.
  • minus for the behaviour of the operation-.
Report an issue
<< getversion Configuration recursionlimit >>

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:
Tue Feb 25 08:52:27 CET 2020