From help-octave-request at bevo dot che dot wisc dot edu Tue Jul 16 07:35:40 2002 Subject: Re: matrix with 3 indices From: Yoel Callev To: help-octave at bevo dot che dot wisc dot edu Date: Tue, 16 Jul 2002 15:33:48 +0300 scherer wrote: >Dear Sir >I am using OCTAVE as a programming language in a course on computational > >methos of Physics. At the moment I am teaching molecular dynamics: on a >rectangular >lattice of cells I need two indices to specify each cell and a third >index to enumerate >the atoms in the cell. In MATLAB I would simply create a matrix A with >elements >A(i, j, k), but this feature is apparently not suported by OCTAVE. Is >there an alternative? >Thanks for your answer. >Claudio Scherer > You can use cells: A{k}(i,j). This way different cells (k's) can contain matrices of different sizes, and these matrices can still be multiplied. You can allocate such arrays with cell(size), and read about it on the MATLAB help under 'cell arrays', athough I havn't found any reference in Octave's help file, this feature does exists in Octave. -Yoel Callev (femto.tau.ac.il/~yoel) ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------