LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

random numbers and running average display ??? please help me out guyz very imp

Create a new VI where the random numbers between 15 and 50 are displayed on a strip chart. Compute
and display the running average of the random numbers and also display it on the chart.

this is one of assignment prob i am running out of time , have to submit it plz help me out
0 Kudos
Message 1 of 5
(3,872 Views)
in this i am able to display the random numbers 15 to 50. but the problem is i am not able to cal "how many numbers i have" to get the running average.???

any suggestion to calulate that.
0 Kudos
Message 3 of 5
(3,861 Views)
this is wat i did till now

0 Kudos
Message 4 of 5
(3,858 Views)

Think about the random number generation. You could just take your [0..1] random number and multiply it by 35, then add 15 to get the [15..50] range. This eliminates the case struture. Seems more reasonable than to generate [0..50] and the throw away everything below 15 as you are doing now.

Then you need to keep track of the sum of all so far acquired random numbers so you can calculate the average. The keyword would be "initialized shift register", something you probably learned in class.

To chart the random number and running average on the same chart, bundle them before the chart to get two traces.

The rest should fall into place after a few tweaks. Good luck!

Message 5 of 5
(3,849 Views)