On 18-Apr-2007, Jordi Gutierrez Hermoso wrote:
| The meshgrid available in Debian's octave2.9-forge package (which I
| imagine must be the same meshgrid in the actual 'Forge pages) makes
| this problem trivially simple to solve. The one in the octave2.1-forge
| package doesn't seem to have this functionality for 3d arrays...
I'm not sure that this is what the OP really wants, but this works in
2.9.10:
tmp(1,1,1,:) = 1:3;
r = repmat (tmp, [3,3,3])
you can use any dimensions, not just [3,3,3] here.