I would like to generate a very large matrix of the form:
[[1,2,3]
,[2,3,4]
,[3,4,5]
...
,[n,n+1,n+2]]
for values of n up to a million or more. How do you do this in matlab/octave?
I'm used to functional programming where I would generate a large list from [1..n]
and map a transforming function on to that list. I assume matlab/octave has a similar idiom for generating large matrices, but I can't find anything.