From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Combination of arrays

Solved!
Go to solution

Hi every one,

 

I have a question about arrays. I looked over the froums but could not find what needed. (Sorry for my confusing subject. I do not know what it should beSmiley Embarassed).

 

I have three arrays: A,B and C. Lets say (in a very simple case) each one has 20 elements (e.g A(1)=2, A(2)=8,...,C(20)=34). Now, the fourth array (called K) should be created by a combination of these A, B, and C. The first element of K should be obtained by sum of C(i)/((A(1)+B(i))^2 which i=1,2,3,...,20. The second element of K: K(2) is sum of C(i)/((A(2)+B(i))^2 and so... (just like attached)

 

I did my best to get this K array but it did not workSmiley SadCould any one please help me about this?

 

Thank you

 

 

0 Kudos
Message 1 of 3
(2,290 Views)
Solution
Accepted by topic author Soran

Hi Soran,

 

try this:

check.png

On the left you see the "literal" implementation, the right one is simplified using LabVIEW's polymorphism…

 

As it's quite easy I don't post a snippet or VI!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 3
(2,259 Views)

Thank you Gerd. It worked.

0 Kudos
Message 3 of 3
(2,217 Views)