Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
2024.1.0 - English


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 — execute Scilab code in strings
  • exec — script file execution
  • evstr — evaluates Scilab expressions and concatenates their results
  • sciargs — scilab command line arguments
  • Scilab startup options — runs Scilab in interactive or batch mode with command line 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:49:16 CEST 2024