01-16-2012 05:51 PM - edited 01-16-2012 05:55 PM
Solved! Go to Solution.
01-16-2012 06:06 PM
This might help you out
01-16-2012 06:10 PM
@ap8888 wrote:
However, I get no output once the for loop finishes.
Please attach your code.
01-17-2012 04:00 PM
Thank you both for the help.
I always thought an indexer of a for loop indexes columns, not rows. But in Fernando's example it seems like rows are being index, then summed.
Why, for example, is the attached not working?
01-17-2012 04:19 PM
array a = [1,2,3]
array b = [1,2,3,4,5]
in LV a+b = [2,4,6].
In your case you are adding [] to [n, n+1, n+2]. You cannot do this.
In this situation, you should have used the "build array" function, right clicked it, and selected "concatenate inputs."
01-17-2012 04:26 PM
@Fernando0901 wrote:
In your case you are adding [] to [n, n+1, n+2]. You cannot do this.
You can do this, it just wont work the way you want 😉
01-17-2012 05:15 PM
I'm a big fan of doing things the easy way.
01-18-2012 02:39 PM
So to verify, the attached two blocks perform the exact same summing (of columns) operation?
Thanks
01-18-2012 04:35 PM
Summed would have the same result in either case- Which is quicker to sling? What if you wanted to really boost the array size and started bogging down a CPU core? Which for loop is parallelizable?
One.jpg on all counts.
Now wait for Altenbach, He'll chime in with a perfomance enhancement
Hold it..... I'm channelling.
For even better perfomance, since the size of the output array can be determined. Initiallize an array of the required size and replace index[i] inside the loop. This prevents re-allocating the array buffer multiple times as the array size grows"
03-27-2015 11:17 AM
Hi
I try to find the number of ones in array at the end but it is not working.
Could some one help?