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

Serge Steer Serge.Steer at inria.fr
Mon May 11 16:38:07 CEST 2015


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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20150511/6123bdbe/attachment.htm>


More information about the users mailing list