help-octave
[Top][All Lists]
Advanced

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

Re: 2D matrixes into a 3D matrix


From: Jordi Gutierrez Hermoso
Subject: Re: 2D matrixes into a 3D matrix
Date: Tue, 30 Jan 2007 11:54:05 -0600

On 29/01/07, Andres Sepulveda <address@hidden> wrote:
  I have 2D fields of sea surface tempereature, say 50x40, and I want to
put them in a 3D array, where the third index is time. The idea is to be
able to add more and more 2D fields for which I need a way to increase
the size of it from

I had a similar problem a while ago (curiously enough, I was also
solving equations in geophysical fluid dynamics). It could be
worthwhile to look into using cells instead of rank 3 tensors. I
obtained a marginal speed increase by using cells:

     octave2.9:1> A{1} = rand(2)
     A =

     {
        [1,1] =

           0.82722   0.44634
           0.13639   0.47667

     }

     octave2.9:2> A{2} = rand(2)
     A =

     {
        [1,1] =

           0.82722   0.44634
           0.13639   0.47667

        [1,2] =

           0.69724   0.51115
           0.17130   0.14712

     }

etc...

HTH,
- Jordi G. H.


reply via email to

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