03-28-2019 11:37 AM
i want to add all the elements at the red arrow place . Thank you first
03-28-2019 11:41 AM
The 0 indicator can generate the elements one by one . How to add all of them together ? Thank you
03-28-2019 12:33 PM
If English is not your native language try using Google Translate because I can not make sense of what your question may be.
Ben
03-28-2019 12:47 PM
I think I understand what you want to do. Here's what I think:
If this is what you want to do, the result is easy to obtain:
Bob Schor
03-28-2019 12:55 PM
I should have asked -- did you wish to watch the sum accumulate, that is, did you want to have, inside the inner loop, a second indicator called, maybe, "Sum 0" that starts at 0, gets the first "0" value, adds the second value, the third value, etc. so you can see not only the "0" indicator change as the inner loop runs, but you can see the "Sum 0" indicator change? The method I just explained does the summation after the loop exits, so you don't see the intermediate sums.
If you do want to see the sums accumulate, you can do that, as well. A little more work:
Bob Schor
03-28-2019 01:15 PM
@Bob_Schor wrote:
I think I understand what you want to do. Here's what I think:
- ...
Bob Schor
If I had a penny for every word I have posted guessing at what I thought a person was asking only to find out latter that my efforts were for not...
Hopefully you guessed right!
Ben
03-28-2019 01:28 PM
Thank you so much for your advice . As u can tell i am not a native english speaker . I am still working at this . Thank you for your concerning again .
03-28-2019 02:04 PM
To help you out, this is an illustration (in "pictures") of the methods I was describing. This is a LabVIEW Snippet, but even if you don't know how to use Snippets, it is simple enough that you should be able to copy it as LabVIEW code.
This is a For Loop (the Wait is so you can watch it run and actually see things happening) where (random) Data are being created and display (once a second) in the indicator Datum. When the For Loop ends, all the Data (which have been brought out through an Indexing Tunnel) and summed and displayed as "Sum of Data". The other method is shown below, starting with a Shift Register (initialized with 0) and used to compute a Running Sum. When the Loop exits, Running Sum should equal Sum (since they both add up the same 8 numbers).
I hope this helps you out, and answers the question you were trying to ask.
Bob Schor
03-28-2019 02:12 PM
Hi , thank you so much . basic on the picture . the "random data" is inside the for loop . And my question is what if the data is outside the loop ?
because the problem i met i dont know how to add it into the for loop just like the “0” indicator in the picture . Thank you so much . and i try to describe all the details in another replying .
03-28-2019 02:20 PM
I am sorry i made it comlicated . i try to explain it .
1.This is parts of the HOG . right now i can get two same size arrays . one of the array , every elements are from 0- 180 . and then classify them into 9 bins . 0-20 20-40 40-60 ....
2. About the other array , we do the calculation at the same position as the first array . such as : the first array the (0,0) is 25° . if the element at the same coordinate (0,0) of second array is 60 . We calculate as following . distance to bin 20 and bin 40 are 5 and 15 degrees ,respectively .
ratios are 15/20=3/4 ,5/20=1/4 . So we vote the value 60 x 3/4 =45 to the 20 bin . and 60 x 1/4 = 15 to the 40 bin .
3. then , suppose they are 8x8 arrays . and we add every values after voting together into the each bins .
4 . after that making a histograph using the 9 bins values .
the question is how to add each value together after calculation. I hope it is a little clear . sorry for my limit english skill and thank you for your help again . i really appreciate it .