LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

3D array arithmetic. (3Dx-1 Element)

Solved!
Go to solution

Hello everyone,

I have a quick question which I have yet to find the answer for anywhere else.

I have a 3 dimensional array that contains one element per dimension. I want to be able to square these elements then add them together. I have accomplished the squaring by using the polymorphic functionality of the square function. Now I want to add all 3 elements ( one element per dimension) into one scalar type. Does anyone know how to do this?

Thanks,
Cheers!

Learning is living.
Co-Founder and CEO of http://3dprintingmodel.com/

"If we did all the things we are capable of, we would literally astound ourselves."
-Thomas Edison
0 Kudos
Message 1 of 4
(3,319 Views)

If you have a 3-D array that is 1 element per dimension, that means you have a 1 x 1 x 1 array, doesn't it?

 

Can you post a VI where you have saved your 3-D array as a constant, and also tell us what you expect the result to be.  Because with the way you described the array, the operations you want to do to it don't make sense.  You say one element per dimension, but then you say you have 3 elements.  A 1 x 1 x 1 3-D array has a grand total of one element.

0 Kudos
Message 2 of 4
(3,305 Views)
Solution
Accepted by topic author tsa256

The Add Array Elements is just as happy with the 3D array as the Square function.

 

21189iF309C4756EC725C1

 

What brings you to this particular structure is perhaps another question.

0 Kudos
Message 3 of 4
(3,301 Views)

Thanks Darin! Very helpful. I can not believe I missed that before. 

I apologize for the crude explanation before. I was wrong, the proper way to describe this would be a  3D "1 X 1 X 1" array.

I have been programming for about a year in LabVIEW. Unfortunately, this year of programming have been very specific up until now, and with no formal training I tend to skip, or overthink problems like these. (Even though there is a built in function)


Thanks for the help.
Have a great day.

Learning is living.
Co-Founder and CEO of http://3dprintingmodel.com/

"If we did all the things we are capable of, we would literally astound ourselves."
-Thomas Edison
0 Kudos
Message 4 of 4
(3,274 Views)