day1/exercise/linspace.py
author Puneeth Chaganti <punchagan@gmail.com>
Thu, 09 Dec 2010 14:34:40 +0530
branchscipyin2010
changeset 439 d85c3ed8545c
parent 64 333092b68926
permissions -rw-r--r--
Updated day1/session1.tex and some image files.

def linspace(a, b, N):
    lns = []
    step = (float(b) - float(a)) / float(N - 1)
    print step
    for i in range(N):
        lns.append(a + i*step)

    return lns

print linspace(0, 5, 11)