Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^6: Randomly biased, random numbers.

by BrowserUk (Patriarch)
on Dec 06, 2013 at 06:57 UTC ( [id://1065908]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1065908]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (4)
As of 2024-04-19 21:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found