Multidimensional Arrays

Probably been asked about before.

Page 1 of 1

2 Replies - 1919 Views - Last Post: 28 November 2009 - 06:57 AM Rate Topic: -----

#1 ell  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 22
  • Joined: 06-August 09

Multidimensional Arrays

Posted 24 November 2009 - 01:28 PM

Hi all, I am struggling with multidimensional arrays, I need a method that can produce an array that acceps an array of dimension sizes e.g.

MultiArray.new([40, 45, 3])


Would produce an array with 40 width, 45 height and 3 layers. I know this is alot to ask and I'm sorry if i'm not in the right spirit of ishow some work and we will help and point you out but I am frustrated at only being able to create 2d arrays and quite strenously! thanks in advance, ell.

Is This A Good Question/Topic? 0
  • +

Replies To: Multidimensional Arrays

#2 EdwinNameless  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 120
  • View blog
  • Posts: 710
  • Joined: 15-October 09

Re: Multidimensional Arrays

Posted 24 November 2009 - 03:25 PM

View Postell, on 24 Nov, 2009 - 12:28 PM, said:

Hi all, I am struggling with multidimensional arrays, I need a method that can produce an array that acceps an array of dimension sizes e.g.

MultiArray.new([40, 45, 3])


Would produce an array with 40 width, 45 height and 3 layers. I know this is alot to ask and I'm sorry if i'm not in the right spirit of ishow some work and we will help and point you out but I am frustrated at only being able to create 2d arrays and quite strenously! thanks in advance, ell.


There are several ways of doing. First, the "simple" way (I can't say I would have come up with it myself). Then, there are libraries providing multidimensional arrays, like narray.

(had you wanted 2 dimensional arrays, you could have also used matrices which are at first a bit tricky to use, and then prove very useful).

This post has been edited by EdwinNameless: 24 November 2009 - 03:25 PM

Was This Post Helpful? 0
  • +
  • -

#3 ell  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 22
  • Joined: 06-August 09

Re: Multidimensional Arrays

Posted 28 November 2009 - 06:57 AM

Wow, thanks a bundle, works a treat! :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1