Henrik Ronellenfitsch wrote: <snip>
Thanks very much for your solution, this is exactly what I needed! If I'm not mistaken, though, you can achieve the same result with
h = hamming(n) ham2d = sqrt(outer(h,h))
which is a bit more compact.
Yes, that's nicer.