use "for" loop to create list





This works too:

(%i1)f(x):=x^2$
????? m: [0,0,0,0,0]$
????? for i: 1 thru 5 do m[i]: [i,f(i)]$
????? m;

(%o4) [[1,1],[2,4],[3,9],[4,16],[5,25]]
... except you have to "pre-declare" m to the right size or it won't work.