day1/exercise/linspace.py
author Prabhu Ramachandran <prabhu@aero.iitb.ac.in>
Tue, 22 Jun 2010 00:06:31 -0400
branchscipy2010
changeset 420 5e408de16a14
parent 64 333092b68926
permissions -rw-r--r--
Minor edits.

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)