If I call a function, I get the following errors:

**Bspln = Bspline(p,knot,t[it])**

MethodError: objects of type Array{Float64,2} are not callable

Use square brackets for indexing an Array.

Stacktrace:

[1] Bspline(::Int64, ::Array{Float64,2}, ::Float64) at ./In[2]:13

[2] top-level scope at ./In[6]:16

function Bspline(p,knot,t)

nb=size(knot,2)-p-1

Bspln=zeros(nb,p+1)

for ip=0:p

for i=1:(nb-ip)

Bspln[i,ip+1]=0

end

end

return (Bspln)

end

p=3

knot=[-1 -1 -1 -1 0 1 1 1 1]

knot=[knot ones(1,p)]

nb=size(knot,2)-p-1

ndt=10 # t steps

t1=minimum(knot)

t2=maximum(knot)

t=t1:(t2-t1)/ndt:t2

nt=size(t,1)

y=zeros(nb,p+1,nt)

for it=1:nt

Bspln = Bspline(p,knot,t[it])

end