# INCOMPLETE FUNCTION (end) error

**URL:** <https://discourse.julialang.org/t/incomplete-function-end-error/22920>\
**Category:** General Usage\
**Tags:** question\
**Created:** [April 8, 2019, 1:37pm UTC](https://discourse.julialang.org/t/incomplete-function-end-error/22920 "2019-04-08T13:37:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Angela\_Mulenga](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/angela_mulenga/32/7507_2.png) [@Angela\_Mulenga](https://discourse.julialang.org/u/Angela_Mulenga)\
**Post date:** [April 8, 2019, 1:37pm UTC](https://discourse.julialang.org/t/incomplete-function-end-error/22920/1 "2019-04-08T13:37:40Z")

</div>

I keep getting the error ‘syntax: incomplete: “function” at none:2 requires end’ but when I check all my fucntions have an ‘end’. Kindly show me where the error is how to correct it. Here is the code:

```julia
function Combination(n, k)
   #number combination n,k
    return factorial(n)/(factorial(n-k) * factorial(k))
end

# calculate binomials
#binomial = [[int(Combination(n, k)) for k in range(0, stop=n+1, length=100)] for n in range(0, stop=20, length=100)]

function B(n, i, t)
   # polynomial berstein
    return binomial[n][i] * (t^i) * (1-t)^(n-i)
end 

function Bezier(t, points)
    #realisation polynomial bezier curve
    n = len(points)
    res =zeros_like(points[0])
    for (i, point) in enumerate(points)
        res += B(n-1, i, t) * point
    return res
end 

function Bezier3(t, points)
    #matrix cubic bezier curve
    points =[points]
    res = ([1, t, t^2, t^3] *[[1, 0, 0, 0]*[-3, 3, 0, 0]*[3, -6, 3, 0]*[-1, 3, -3, 1]])
    res = (res*points)
    return res
end 
    
function Bezier2(t, points)
    #matrix quadratic bezier curve
    points = [points]
    res = ([1, t, t^2]* [[1, 0, 0]*[-2, 2, 0]*[1, -2, 1]])
    res = (res*points)
    return res
end
    
points = [(5.0, 2.0), (-2.0, 3.0), (-1.0, 4.0), (4.0, 5.0)]
points = [points]

T = range(0, stop=1, length=1000)
# test universal time
@time Bs =([Bezier(t, points) for t in T]).T
# vs time matrix realisation
@time Bs3 = ([Bezier3(t, points) for t in T]).T

```

---

<div class="post-metadata">

**Author:** ![mauro3](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mauro3/32/292_2.png) [@mauro3](https://discourse.julialang.org/u/mauro3)\
**Post date:** [April 8, 2019, 1:54pm UTC](https://discourse.julialang.org/t/incomplete-function-end-error/22920/2 "2019-04-08T13:54:21Z")

</div>

Please quote your code: [PSA: how to quote code with backticks](https://discourse.julialang.org/t/psa-how-to-quote-code-with-backticks/7530), it’s (almost) impossible to help otherwise.

---

<div class="post-metadata">

**Author:** ![aharoun](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aharoun/32/6887_2.png) [@aharoun](https://discourse.julialang.org/u/aharoun)\
**Post date:** [April 8, 2019, 2:03pm UTC](https://discourse.julialang.org/t/incomplete-function-end-error/22920/3 "2019-04-08T14:03:46Z")

</div>

It seems you are missing `end` to close the for loop in `Bezier(t, points)` function.
