RandomBarsGenerator scripts for MATLAB

Instructions:

1. Unzip all the files in some folder
2. Import some data to MATLAB (preferrably 1 minute or tick data for method 2).
   This data is used to generate weights/bins for monte carlo simulator (GenerateRandomWalk-script).
   I recommend you to use either ticks or one minute bars. Ticks will generate most
   accurate results but the resulting bars will be tick-bars instead of time-based bars
   unless you modify these scripts.
3. To generate random bars:

   bars = GenerateRandomBars(t, c, acc, tn, n)

   where 
   
   t - time (in datenum format) of the original data
   c - close (open, high or low are not required) of the original data
   acc - accuracy, bigger number generates more accurate bins/weights
         so random data will use similar frequencies to the original data.
         Higher value increases accuracy but makes calculations slower
   tn - Timeframe of the generated bars. For example if you use one minute closes
        you can use value 1440 to generate daily bars.
   n - How many bars to generate?

4. You can graph the results using candle command or export it to ascii and import to
   another program