[Scilab-users] Invalid Index error when using for and select

MattM mattmorris100 at yahoo.co.uk
Tue May 7 18:34:31 CEST 2013


Hi, Im using the following code:
n=1
q=2

for t=0:1:15
    select t
    case 0
        B(0)=0
    else
        B(t) = abs(besselj(q,q.*1/15*t)/(q.*1/15*t));
    end
end


t2=linspace(0,1,15);

plot2d(t2,B)

To define B at the points t=0,1,2,3...16, however as there is a t on the
denominator scilab doesn't let me plot this for t=0. I still want to include
this point however. I have tried using select and cases to define B(0) as
being equal to zero, however I get an invalid index error. 

Thanks 
Matt



--
View this message in context: http://mailinglists.scilab.org/Invalid-Index-error-when-using-for-and-select-tp4026668.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.



More information about the users mailing list