Here I go with my basic questions again, but please bear with me.
In Matlab, is fairly simple to add a number to elements in a list:
a = [1,1,1,1,1]
using List Comprehension:
>>> L = [1]*5 >>> [x+1 for x in L] [2, 2, 2, 2, 2] >>>
which roughly translates to using a for loop:
>>> newL = [] >>> for x in L: ... newL+=[x+1] ... >>> newL [2, 2, 2, 2, 2]
or using map:
>>> map(lambda x:x+1, L) [2, 2, 2, 2, 2] >>>