[Scilab-users] scicos_simulate error

Clément David clement.david at scilab-enterprises.com
Tue Oct 16 15:49:52 CEST 2012


Hello,

Before performing anything related to Xcos (or scicos), you should first
load the Scilab macros with : loadXcosLibs().

See: help loadXcosLibs

In your case, the do_eval macro is not defined (not loaded).

Le mardi 16 octobre 2012 à 14:40 +0200, Stéphane Bécu a écrit :
> Hello
>  
> I'm using scilab 5.4 with Xcos module. Due to the bug 10434 ("clear"
> command erases scilab variables) on scilab 5.4.0, I'm using the
> current nightly build scilab-branch-5.4-1350142218 version. With this
> version, the "clear" issue has been fixed so that I can use Xcos
> variables but now the 'scicos_simulate()' function gives: 
> !--error 21 
> Index invalide.
> at line      99 of function do_eval called by :  
> at line     216 of function scicos_simulate called by :  
> scicos_simulate(scs_m);
> 
> For information, I've checked that scicos_simulate.sci and do_eval.sci
> functions are the same for both scilab-5.4.0 and
> scilab-branch-5.4-1350142218 versions.
>  
> Please see the scilab example for using 'scicos_simulate()' function:
>  
> ->importXcosDiagram("SCI/modules/xcos/demos/batch_simulation.xcos")
>  ans  =
>  
>   T  
>  
> -->
>  
> -->typeof(scs_m) //The diagram data structure
>  ans  =
>  
>  diagram   
>  
> -->
>  
> -->//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 
>  
> -->scicos_simulate(scs_m);
>  !--error 21 
> Index invalide.
> at line      99 of function do_eval called by :  
> at line     216 of function scicos_simulate called by :  
> scicos_simulate(scs_m);
>  
>  
> -->// Change the final time value
>  
> -->Context.Tf=10;
>  
> -->scicos_simulate(scs_m,Context);
>  !--error 21 
> Index invalide.
> at line      99 of function do_eval called by :  
> at line     216 of function scicos_simulate called by :  
> scicos_simulate(scs_m,Context);
>  
>  
> -->// without display
>  
> -->Context.Tf=10;
>  
> -->Context.Pulsation=9;
>  
> -->scicos_simulate(scs_m,list(),Context,'nw');
>  !--error 21 
> Index invalide.
> at line      99 of function do_eval called by :  
> at line     216 of function scicos_simulate called by :  
> scicos_simulate(scs_m,list(),Context,'nw');
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users

-- 
Clément DAVID
Development Engineer
-----------------------------------------------------------
Scilab Enterprises
143bis rue Yves Le Coz - 78000 Versailles, France
Mobile: +33.6.26.26.51.90
Phone: +33.2.90.22.78.96
http://www.scilab-enterprises.com




More information about the users mailing list