LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sum in a 3D array

Solved!
Go to solution

Hello,

 

 

I have a 3 dimension array. On the 10 rows i have 10 coefficients. On the collums i have an index representig the data for whitch the coefficients were built. On the third dimension, the page, i have, basically, the time evolution of the index-coefficient structure. What  i need to do is make a simple sum like this: for each row-collum combination i have to sum the corresponding elements on the pages. I do not know hot to do this...

 

 

Can anyone help me please?

0 Kudos
Message 1 of 12
(3,780 Views)

Use a For Loop to iterate through the pages and add each 2-D array to a running sum that you store within a shift register that is a 2-D array.

Message 2 of 12
(3,774 Views)

Can you just sum all the pages?

0 Kudos
Message 3 of 12
(3,773 Views)

0 Kudos
Message 4 of 12
(3,739 Views)
Solution
Accepted by topic author valentina.alina

See below.

 

Message 5 of 12
(3,718 Views)

Thank you for the example. Unfortunatelly i have an error and i do not understand why... the interrupted line on the left is the 3D array. Can you please help me with this?

 

[Edit]: i've seen the problem...i put the wrong block. Smiley Embarassed

0 Kudos
Message 6 of 12
(3,687 Views)

Yep.  You used Insert into Array (I find I rarely ever need that one), and you need Index Array (which has got to be the most heavily used of the array functions.)

 

I did this to get a 2-D array of the correct dimensions (by indexing out 1 page from the 3-D array) so that all the other pages can be added up.

0 Kudos
Message 7 of 12
(3,667 Views)

Here's just another alternative....

 

 

Message 8 of 12
(3,662 Views)

I knew you'd come up with a more compact way. Smiley Happy

 

Though the idea of "zeroing" an array (by multiplying by zero) to initialize it  is something I think I learned from you in some past thread.

0 Kudos
Message 9 of 12
(3,658 Views)

Thank you all for your responses!!

 

What shall i modify if i need to find the maximum. If the dimensions are: 74 pages, 24 rows and 10 collums  i need a resulting 24 rows and 10 collums 2d array containing the maximum of the corresponding elements in the pages. i tried the Array max & min function but it does not meet the behaviour i need...it gives me the global maximum, wheres i need a set of local max.

0 Kudos
Message 10 of 12
(3,644 Views)