[Scilab-users] xcos : xcos_simulate(scs_m, 1) or xcos_simulate(scs_m, 4)

Clément David clement.david at scilab-enterprises.com
Wed Oct 1 10:08:27 CEST 2014


Hello Quentin,

> 1) It uses the function scicos_simulate instead of xcos_simulate. 
> ->Are these two functions equivalent or not?
> ->What should be the best syntax for next version of scilab?
> ->Which one should be the fastest?

Both scicos_simulate and xcos_simulate will be supported in the future.
Note that the main difference are:

 * xcos_simulate invoke pre / post simulation hook ; it is called when
the user click on simulation "Start"
 * scicos_simulate can re-use the Info and update context. It bypass
more compilation / simulation steps depending on the arguments value.

> 2) This example supposed that values are defined in Xcos context. It is not
> my case. The context is empty and I change the Xcos input variables by using
> a scilab script as following : 
> my_input1 = 10;
> my_input2 = [5;1;3]
> my_input3 = ...
> ->Is it a good practice?
> ->Will it impact my simulation time?

Well, both approach fill a specific need. With a setup script it is
slightly easier to edit execute and test using scinotes. Using the
diagram context all the information are contained inside the ZCOS file ;
you can easily mail it.

Let's say : for more than 10 variables or if it contains Scilab function
calls the setup script is much more manageable.

--
Clément





More information about the users mailing list