1

I have a thousand sample. 200 of them are wrong in the sense that they are to nearest integer when it should have had a 2 decimal precision. So instead of a value of say 1019g it should have been 1018.76g!!

I decided i need to randomly generate 2 decimal and add them to the 200 anomalies The challenge is that values should be increasing or staying the same. e.g

1019.0 1019.0 1020.0 1020.0 1020.0 1020.0 1020.0 1020.0 1020.0 1020.0 1020.0

Should be something like

1019.12 1019.19 1020.23 1020.31 1020.34 1020.36 1020.39 1020.46 1020.50 1020.58 1020.62

how do i carry this In say MATLAB or Excel? It there a smart formula for that other than Value + rand(between 0 and less than 1) . Solution has to :

  1. be consistent. same random number always.
  2. be increasing. So the second sample has to be larger or equal than the previous one.
  • 1
    Simplest solution is to generate the random numbers and then sort the values. Given that it is only for 200 numbers, this should work just fine. – David May 05 '17 at 21:46
  • If you want the simulation to come out the same way each time, then the random number generator should be used with a fixed seed. – Brian Tung May 05 '17 at 22:32

0 Answers0