[scilab-Users] Creation of variable and graphical handles programmatically

Sébastien Bihorel pomchip at free.fr
Mon Oct 12 14:26:06 CEST 2009


It's working great. Thank you very much !

On Mon, Oct 12, 2009 at 7:46 AM, Pierre LANDO <pierre.lando at scilab.org>wrote:

> Try something like that : execstr instead of eval
>
>
> figure();
>
> nstates=6;
> ndim= ceil(sqrt(nstates));
> multi=pmodulo((1:nstates)-1,ndim);
> marg=0.05;
>
> for (j=1:nstates)
>   execstr('g' + string(j) + '=newaxes()');
>   execstr('g' + string(j) + '.axes_bounds=[' + string(multi/ndim) + ','
> +...
>         string(marg + multi*(1-marg)/ndim) + ',' +...
>         string(1/ndim) + ',' +...
>         string((1-marg)/ndim) + ']');
> end
>
>
>
> Sébastien Bihorel a écrit :
>
>> Dear Scilab users,
>>
>> I wonder how one can create variables or graphical handles
>> programmatically and assign values to them at the same time. For instance,
>> consider the following attempted code where nstates 'sub-plots' should be
>> created within a figure (please, note that I don't want to use the subplot
>> function for some other reason). This syntax is obviously wrong, according
>> to the Scilab error message, but I do not know how to fix that. Any help
>> would be greatly appreciated.
>>
>
>
> --
> -------------------------
> Pierre LANDO
> Ingénieur de développement
> -------------------------
> Consortium Scilab
> Digiteo
> Domaine de Voluceau
> Rocquencourt - B.P. 105 78153 Le Chesnay Cedex France
> Tél. : +33.1.39.63.58.21
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20091012/fafc1340/attachment.htm>


More information about the users mailing list