Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
2024.1.0 - Français


scilab

run command or file in another Scilab

Syntax

[err, stdout, stderr] = scilab(code, file, mode, quit, args)
scilab(..., background)

Arguments

code

command to execute in the new Scilab.

file

file to execute in the new Scilab.

mode

"nwni": to start a new Scilab without graphical and Xcos features.

"nw": to start a new Scilab with graphical and Xcos features. (default)

quit

boolean to indicate if Scilab must quit after execution (default: %t)

args

Other arguments to pass to the new Scilab, they can be retrieved via sciargs.

background

boolean to indicate that the new Scilab must be launched in a detached process without waiting for end of execution to continue.

If background is %T the function will not return any value.

err

status of execution (0 if succeeded).

stdout

Content of Standard Output.

stderr

Content of Standard Error.

Description

Executes code or file in a new Scilab and returns status and logs.

Remarks

code and file are mutually exclusive.

We recommand to use this function with named arguments (see examples)

Examples

//execute 1+1 in a new Scilab and exit at the end
[status, stdout, stderr] = scilab(code="1+1")
//execute 1+1 in a new Scilab and exit at the end without graphics
[status, stdout, stderr] = scilab(code="1+1", mode="nwni")

tmp = tempname();
mputl("1+1", tmp);

//execute 1+1 in a new Scilab and exit at the end
[status, stdout, stderr] = scilab(file=tmp)
//execute 1+1 in a new Scilab and exit at the end without graphics
[status, stdout, stderr] = scilab(file=tmp, mode="nwni")

See also

  • execstr — exécution d'instructions Scilab contenues dans des chaînes de caractères
  • exec — exécution d'un script (fichier de commandes)
  • evstr — évalue des expressions Scilab et concatène leurs résultats
  • sciargs — arguments sur la ligne de commande Scilab
  • Scilab startup options — lance Scilab en mode interactif ou batch avec options

History

VersionDescription
2024.1.0 scilab function introduced
Report an issue
<< host OS_commands setenv >>

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:
Mon Jun 17 17:52:28 CEST 2024