Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
5.5.0 - Русский

Change language to:
English - Français - 日本語 - Português -

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

Справка Scilab >> Xcos > Batch functions > scicos_simulate


Function for running xcos simulation in batch mode

Calling Sequence

Info=scicos_simulate(scs_m ,Info [, context] [,flag])


scs_m: A diagram data structure (see scs_m structure).

Info: A list. It must be set to list() at the first call, then use output Info as input Info for the next calls. Info contains compilation and simulation information and is used to avoid recompilation when not needed.

ContextValues: A Scilab struct containing values of symbolic variables used in the context and xcos blocks.

flag: A string. If it equals 'nw' (no window), then blocks using graphical windows are not executed. Note that the list of such blocks must be updated as new blocks are added.



This function is used to simulate xcos diagrams in batch mode. It requires the scs_m structure which can be obtained by loading in Scilab the .zcos file (see importXcosDiagram ).

The ContextValues may be used to change the main parameters value set in the main diagram context. example: if the variable A is set to 1 in the main context of the diagram. One can change the A value for a scicos_simulate simulation by setting


It is also possible to use variables defined inside Scilab directly without using the ContextValues argument, but for such a use the context definition must allow this: example, if one wants to allow simulation use the A Scilab variable value for the parameter A the diagram context definition should contain

if ~exists('A') then  A=1,end
Note that this second solution is fragile because it rely on the current value of A in Scilab.

File content

  • SCI/modules/scicos/macros/scicos_auto/scicos_simulate.sci


The xcos diagram in SCI/modules/xcos/demos/batch_simulation.zcos.


typeof(scs_m) //The diagram data structure

//This diagram uses 3 context variables : 
//  Amplitude : the sin function amplitude
//  Pulsation : the sin function pulsation
//  Tf        : the final simulation time
scs_m.props.context; //the embedded definition

//first batch simulation with the parameters embedded in the diagram 
// Change the final time value
// without display
//get the variable created by the "from workspace block"
Report an issue
<< lincos Batch functions scicosim >>

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:
Fri Apr 11 14:19:42 CEST 2014