[Scilab-users] linspace() generates error 21 - Invalid index.

Piotr Grudzinski piotr at powersmiths.com
Mon May 11 16:52:25 CEST 2015


Thanks for the quick response. It works OK now.

On Mon, May 11, 2015 at 10:38 AM, Serge Steer <Serge.Steer at inria.fr> wrote:
> Le 11/05/2015 16:26, Piotr Grudzinski a écrit :
>
> Hello all,
>
> There is a file attached to this email to demonstrates the problem.
>
> The callback of the second button calls test_linspace() and there is no
> problem.
>
> The callback of the first button calls rb_selected() which then calls
> test_linspace() and the following error is generated:
>
>
>  button 1
>  !--error 21
> Invalid index.
> at line      22 of function linspace called by :
> at line       2 of function test_linspace called by :
> at line       7 of function rb_selected called by :
> allbackobject(225);rb_selected(1);if exists("%oldgcbo") then gcbo
> while executing a callback
>
> Am I doing something wrong?
>
> Your problem is due to the type function redefinition
> the rb_selected function should be written as follow
>
> function rb_selected(typ)
>     if (typ == 1) then
>         disp('button 1');
>     else
>         disp('button 2');
>     end
>     test_linspace();
> endfunction
>
>
> Regards,
> Piotr
>
>
>
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>
>
>
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>



More information about the users mailing list