LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Loop subtraction between two arrays

Solved!
Go to solution
Solution
Accepted by topic author libbyherself
Message 11 of 16
(1,107 Views)

firstly thanks for all of your responses and time.

I have attached the VI as you suggest, I didnt want to do that originally because, as youll see theres a lot more going on in it, and well i know a lot of it is probably not "correct" or the best way to do things but it works for me and does what i need, and im not finished with it.

 

So, setting that aside, Array A is the one of 8 elements, Array B is the one i want to subtract from. I have also attached an example of the text files I am using, there a lot of them so im only attaching one just so you can see the format. 

 

Hope this helps you help me, it may just make things more messy and confusing

 

Download All
0 Kudos
Message 12 of 16
(1,105 Views)

This worked perfect for me, thank you!!!!

0 Kudos
Message 13 of 16
(1,102 Views)

(Ah, I've seens part of that code before. You really should move the "spreadsheet string to array" out of the loop.)

 

SImply wire the "A" array to the lower input of the new for loop (remove the other small for loop, because it was to generate fake data, which you don't need). The rest should fall into place.

 

I am not sure why you re-read all files and do all these computations millions of times per second, because nothing changes between iterations of the inner loop. Once is enough! Save the electrons! 😄

0 Kudos
Message 14 of 16
(1,098 Views)

Just for fun, here's replacement code that does about the same thing of the bulk of your code. (might need a few tweaks).

 

(e.g. whatever you were doing to extract a simple colum from a 2D array was just mindboggling (array subset, transpose, reshape etc.)

 

 

Message 15 of 16
(1,088 Views)

thanks so much for youre input this is a HUGEEE help!

0 Kudos
Message 16 of 16
(1,064 Views)