I'm not exactly sure what you are trying to do but maybe it is something 
like this:

x = [-1:1:2]
inter = polyal(Poly([1, -2, 1]), x)

for i in 1:length(x)
    if inter[i] == 0
        println("root in x=", x[i])
    end
end

kl. 12:14:58 UTC+2 tirsdag 6. mai 2014 skrev Albert Díaz følgende:
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> *using Polynomialx=[-1:1:2]inter=polyval(Poly([1,-2,1]),x)for n in 
> [x[1]:x[end]]        if inter[n]==0        println("root in x=",n)endend*
>
> I get a BoundsError() and I don't know how could I fit the x range in the n 
> array to evaluate different values in inter each time the for loop occurs.
>
>

Reply via email to