Let's say I have a single column float array of non-integer values:
Data = [1.1 ; 1.2 ; 1.3 ; 1.4 ; 1.5]
I would like to generate random numbers between two sequential values in this array and store those value in a new array. I.e the first value in the new array would be a random number between 1.1 and 1.2, the next random number between 1.2 and 1.3 and so on.
I'm looking to obtain a new array like data_rand = [1.15 ; 1.24 ; 1.37 ; 1.46] based on the original data array.
My question is (how would I / what is the best method to) iterate through all the values in an array and generate a non-integer random number between the each subsequent pair of numbers in the array, saving these random numbers into a new array? Could somebody provide an example based on this small 5-value data array? Or point me in the right direction for each stage of the process.
list
, like[1.1, 1.2, 1.3]
? What have you tried so far, and what exactly is the problem with it?