06-06-2012 01:45 AM - edited 06-06-2012 01:46 AM
I want to make a VI that will show me how many random numbers from 0-100 range should be generated. After that VI should draw a histogram, showing how many percent of numbers were from 0-49 range and how many from 50-99. There should also be two numeric indicators showing how many numbers were from both of those ranges.
I use "In range and coerce", but for example if I generate numbers: 78, 97,74;
First "In range and coerce" (50-99)" will show output: 78, 97,74, which is correct.
But second "In range and coerce" (0-49)" will show output 49,49,49 which I dont want; I just want to show in this example one zero.
After that I will connect both input to histogram, will be OK ?
See picture, thanks
Solved! Go to Solution.
06-06-2012 02:05 AM - edited 06-06-2012 02:07 AM
Hi hlod,
did you read the context help for InRangeAndCoerce? That would clear up your first qeustion...
Did you try the histogram VI without any InRangeAndCoerce? It's all you need...
06-06-2012 02:08 AM
If your only goal is to plot an histogram, use the histogram function from the probability & statistics palette :
We have two ears and one mouth so that we can listen twice as much as we speak.
Epictetus
06-06-2012 02:23 AM - edited 06-06-2012 02:24 AM
Wll I must show on histogram "how many percent of numbers were from 0-49 range and how many from 50-99.", so for this reason I'm using "In Range and Coerce Function". But I have problem which I already described.
06-06-2012 02:28 AM - edited 06-06-2012 02:28 AM
06-06-2012 02:31 AM - edited 06-06-2012 02:33 AM
Yes I know that but I have probelms, that from 3 input numbers,"in range and coerce" function make:
78, 97,74 and 49,49,49;
From 3 input numbers I need 3 output not 6 :/. If it's not in range, why than show 49,49,49 ?
After that I will make front side as this on picture
06-06-2012 02:32 AM - edited 06-06-2012 02:34 AM
Hi hlod,
did you read message #2? Then you would have read the context help for that function and in turn you would know, why it outputs 49 for your second case...
That's the way "In Range and Coerce" works... Well, this function has a second output. You could use that to count the numbers in the given range... But hey, it is all written in the context help!
Did I mention the context help before?
06-06-2012 02:35 AM
Yes I read it, but I cannont make VI as on picture 1 post up. (please look it), I need function "in range and cou.."
06-06-2012 02:37 AM - edited 06-06-2012 02:37 AM
06-06-2012 02:37 AM
I really think you should not use the "in range coerce" primitive...
Is this what you're trying to get?
We have two ears and one mouth so that we can listen twice as much as we speak.
Epictetus