LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

adding two arrays together


altenbach wrote:

Cory K wrote:

For some reason, once I start thinking about something, I automatically start coding without checking if there is a function that already does the desired task. That would probably be a good thing to start doing.


Oh, I know how that works! 😄

 

At least you found a nice "in-place" solution. Some would have added things via value property nodes. 😮


Or local variables. Smiley Very Happy

0 Kudos
Message 11 of 15
(1,266 Views)

Hi Guys,

What if I wish to do the same thing, but my data is an array of 128x128 elements?

 

If the camera takes 10000 scans, I wish to average the values of scans 1-4 into different arrays and output them?

 

i.e.

File 1= Scans 1, 5, 9, 13, ... etc 

File 2= Scans 2, 6, 10, 14... etc

File 3= Scans 3, 7, 11, 15... etc

File 4= Scans 4, 8, 12, 16... etc

 

Thanks very much!!

0 Kudos
Message 12 of 15
(1,027 Views)

Hi Jaslyn,

 

This thread is about 4 years old, so there has been quite a bit of functionality change in how these functions work. I would suggest creating a new thread, but here's how I think your application could work.

 

If you create a simple for loop with your array at each iteration and use a Quotient and Remainder to select which file to save to (using the remainder), you will end up appending each iteration to the correct file. Here's a basic mockup:

 

Array average.png

 

Again, if you have more information, I'd recommend creating a new thread; it might be more helpful for exposure. Hope this helps! 

Xavier
Message 13 of 15
(1,003 Views)

You probably want to use the remainder output rather than the quotient output.

0 Kudos
Message 14 of 15
(999 Views)

Gee thanks a lot, xaww and RavensFan.. I didn't even know the remainder output function existed!! 🙂

0 Kudos
Message 15 of 15
(979 Views)