day1/exercise/linspace.py
author Shantanu <shantanu@fossee.in>
Wed, 18 Nov 2009 22:30:43 +0530
changeset 315 141f3903d4e8
parent 64 333092b68926
permissions -rw-r--r--
Modified Matrix operation part of cheat sheet 4.

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)