Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Referencing multidimensional array

Hi,

I have a variable number of 3x3 matrices in a 3-D array. I have
dimensioned as follows:

ReDim MatrixA_3x3(1 To lngLastRow - 2, 1 To 3, 1 To 3)

The entire array is populated correctly, as the elements are as I
expect -- MatrixA_3x3(i, j, k) is accurate.

How can I reference the individual 3x3 matrices so that I can calculate
the determinant of each one? I have the following:

arrA_Determ(i) = Excel.Application.MDeterm(MatrixA_3x3(i))

The code is bombing with a "subscript out of range error." on the
MatrixA_3x3(i) part.

Is it possible to reference the entire array based on the first
dimension, or do I need to junk this approach? (Not a problem to do
so, if necessary)

The obvious choice would be to use a 2-D array, but I would like to see
the underlying matrices.

Thanks,
Jay Petrulis

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Referencing multidimensional array

You approach won't work. You could do an array of arrays

Dim MasArray() as Variant
Redim MasArray(1 to lngLastRow-1)

then for example

MasArray(2) = Range("A1:C3").Value

now MasArray(2) holds a 3 x 3 array.

then you could do

arrA_Determ(2) = Excel.Application.MDeterm(MasArray(2))

(replace the 2 with i)

--
Regards,
Tom Ogilvy


"Jay Petrulis" wrote in message
ups.com...
Hi,

I have a variable number of 3x3 matrices in a 3-D array. I have
dimensioned as follows:

ReDim MatrixA_3x3(1 To lngLastRow - 2, 1 To 3, 1 To 3)

The entire array is populated correctly, as the elements are as I
expect -- MatrixA_3x3(i, j, k) is accurate.

How can I reference the individual 3x3 matrices so that I can calculate
the determinant of each one? I have the following:

arrA_Determ(i) = Excel.Application.MDeterm(MatrixA_3x3(i))

The code is bombing with a "subscript out of range error." on the
MatrixA_3x3(i) part.

Is it possible to reference the entire array based on the first
dimension, or do I need to junk this approach? (Not a problem to do
so, if necessary)

The obvious choice would be to use a 2-D array, but I would like to see
the underlying matrices.

Thanks,
Jay Petrulis



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Referencing multidimensional array

Thanks Tom.

I kinda figured as such. I will make two arrays -- one to generate the
matrices and one as a pointer so that I can calc the determinant.

Appreciate the help.

Regards,
Jay Petrulis

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using Application.match against one dimension of a multidimensional array? KR Excel Programming 1 January 24th 05 10:01 PM
Multidimensional Array DavidMoeller Excel Programming 4 August 12th 04 08:12 PM
MAX of Multidimensional Array ZZZ Excel Programming 2 November 15th 03 03:32 PM
Multidimensional Array problem I can't solve ! Please help me out ! David Van Heuverswyn Excel Programming 3 October 6th 03 01:49 PM
size of multidimensional dynamic array ThatFella[_2_] Excel Programming 4 September 3rd 03 11:53 PM


All times are GMT +1. The time now is 04:42 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"