03-07-2015 02:28 PM - edited 03-07-2015 02:32 PM
Currently, I'm using feedback nodes to compare the current random integer being produced to the previous ones. I need to display the overall min/max values that have been generated thus far. For the first iteration, the feedback node has no value and thus compares the random integer to 0, which makes it a maximum and it works. However, for the minimm part... the feedback node is comparing 0 to the first iterated random number, so 0 keeps being outputted as the random number. Is there a fix to this?
The problem is: Use a For Loop to generate 100 random numbers. Determine the most current maximum and minimum number as the random numbres are being generated. This is soemtimes referred to as "running" max and min. Display the numbers on the front panel in addition to the current random number.
I am currently using feedback nodes and the min/max function in my program
03-07-2015 02:32 PM - edited 03-07-2015 02:33 PM
Initialize the feedback nodes with +Inf or -Inf depending on whether you are lookin for the minimum or maximum.
03-07-2015 02:33 PM
This sounds like a school assignment. Here are some hints:
How many values do you need to keep? How many feedback nodes do you need to store those values? What is the appropriate initial value for the minimum?
Lynn
03-07-2015 02:36 PM
How do I do that and also how do I set infinity as a constant? Sorry, I am just learning.
03-07-2015 02:41 PM
Infinity constants are on the Numeric palette.
Lynn
03-08-2015 12:07 AM - edited 03-08-2015 12:39 AM
There is a ptbypt function for that. No extra code needed.
(Set the sample lenght to zero and intialize if i=0, i.e. in the first iteration.)