[Top][All Lists]

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

Re: matrix with 3 indices

From: Yoel Callev
Subject: Re: matrix with 3 indices
Date: Tue, 16 Jul 2002 16:22:26 +0300
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20010901

Yoel Callev wrote:

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
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
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

Apperantly this was a mistake, cells don't work in Octave yet, (or at least not in the MATLAB syntax), but there is a different quick & dirty solution - just use:


and work with matrices named my_matrix1,my_matrix2 etc.

  -Yoel Callev (

Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:
How to fund new projects:
Subscription information:

reply via email to

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