02-24-2021 11:31 AM
Hi!
I am trying to store my data in an array. I can get an input 3-18, and then I want to store, how many times I got the indvidual numbers. Like 3-3s, 2-4s, etc. So my idea is to make an array full of 0-s, and then add one to the element, which index is the input minus 3. But I cant convert my numeric input to long(The type of the source is 1D array of
long
[32-bit integer (-2147483648 to 2147483647)].
The type of the sink is long [32-bit integer (-2147483648 to 2147483647)].),
and I would need an array, which has in- and output. Could someone please help me out?
Solved! Go to Solution.
02-24-2021 11:55 AM
Start with a few simple tutorials. (There is no toplevel loop, the case structure and boolean serve no purpose, there is a "+1" primitive which you could avoid by rounding towards +inf instead. etc.)
Your question is not clear. All you probably need is one loop to do everything. The index input to "replace array subset" is a scalar, so you need to process it one element at a time, for example in a FOR loop.)
Also please attach your actual VI. It is impossible to run and debug pictures.
02-24-2021 12:12 PM - edited 02-24-2021 12:14 PM
Here's one possible solution. (Note that I also just attach an image instead of a VI to give you something to do ;))
02-24-2021 12:15 PM
Thank you so much! I need to round downvards, because I dont want to have a 0 output, which happens, if the random number generator gives me 0. But thanks for the other stuff!
02-24-2021 12:19 PM - edited 02-24-2021 01:11 PM
The help is wrong. The random number cannot be zero.
EDIT: This page is correct and uses the same wording as the original paper by Wichmann&Hill.
"... rectangularly (evenly) distributed between 0 and 1, excluding the end points ..."
So yes, zero or one cannot occur!