help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

uniform random variable in oct file?


From: Michael Creel
Subject: uniform random variable in oct file?
Date: Fri, 08 Sep 2006 12:44:02 +0200
User-agent: Thunderbird 1.5.0.5 (X11/20060812)

I'm wondering what's the most efficient way to get a U(0,1) draw in an .oct file. I'm currently using

        f_return = feval("rand");
        rand_draw = f_return(0).double_value();

This works fine. The Octave Wiki, at http://wiki.octave.org/wiki.pl?CPPQuickReference, suggests

        octave_rand::distribution("uniform"); octave_rand::matrix(a,b)

What are the advantages / disadvantages of the two options?

Thanks, Michael


reply via email to

[Prev in Thread] Current Thread [Next in Thread]