in reply to Re^5: Randomly biased, random numbers.
in thread Randomly biased, random numbers.

In Matlab, it looks something like this for a 10-step function:

Great, thanks. Now all I gotta do is translate that from matlab, a lingo I am not familiar with.

Darn it. Fell at the first hurdle. I cannot sense of your parameters to unifrnd()?


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^7: Randomly biased, random numbers.
by educated_foo (Vicar) on Dec 06, 2013 at 07:04 UTC
    Sorry -- it's much terser than Perl for math.
    unifrnd(MIN, MAX, ROWS, COLUMNS); # uniform random numbers in [MIN,MAX +) cumsum(VECTOR) = #cumulative sum of vector # .OP = element-wise application of OP to operands

      Is this fx(ix) (roughly) equivalent to this: @fx[ @ix ]?

      If it is, then I don't understand how you can index the 10-element fx with the 1e5-element ix?


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.
        Is this fx(ix) (roughly) equivalent to this: @fx[ @ix ]?
        Yes. @ix contains 1e5 numbers all between 1 and 10 (Octave/Matlab is 1-based), so it chooses 1e5 elements from fx.