help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 3D array index as the element itself?


From: Jordi Gutierrez Hermoso
Subject: Re: 3D array index as the element itself?
Date: Wed, 18 Apr 2007 18:55:45 -0500

On 18/04/07, John W. Eaton <address@hidden> wrote:
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.


Ooh, is that a new feature of repmat in 2.9.10? The documentation in
2.9.9 seems to imply that repmat only works on matrices, not N-d
arrays. Hm, once Debian devs fix the problems with the 'forge and the
2.9.10 packages, I'll upgrade.

Thanks,
- Jordi G. H.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]