From: Gigi Dioda on
Hi,
I tried to use the standard toolbox betarnd function for a simple project but I got stuck right from the beginning in what appears to be a bug.

My code is:

y = betarnd(2,5,1,10000);
hist(y,100);

and I get the error:

Warning: Input arguments must be scalar.
> In randg at 18
In betarnd at 34
In Continuous1 at 5
Warning: Input arguments must be scalar.
> In randg at 18
In betarnd at 35
In Continuous1 at 5
??? Error using ==> plus
Matrix dimensions must agree.

Error in ==> betarnd at 36
r = g1 ./ (g1 + g2);

Error in ==> Continuous1 at 5
y = betarnd(2,5,1,10000);


I even tried in the console the example from the Matlab Help of betarnd:

r = betarnd(4,2,2,3)

and I get a similar error.

My Matlab version is:

MATLAB Version 7.7.0.471 (R2008b)
MATLAB License Number: 167507
Operating System: Linux 2.6.31.1 #1 SMP Tue Sep 29 15:29:30 CEST 2009 x86_64
Java VM Version: Java 1.6.0_04 with Sun Microsystems Inc. Java HotSpot(TM) 64-Bit Server VM mixed mode

and the Statistics Toolbox version is: Version 7.0 (R2008b)

Thanks a bunch,
G
From: Steven Lord on

"Gigi Dioda" <valeriu_cod(a)yahoo.com> wrote in message
news:hulhd8$ome$1(a)fred.mathworks.com...
> Hi,
> I tried to use the standard toolbox betarnd function for a simple project
> but I got stuck right from the beginning in what appears to be a bug.
>
> My code is:
>
> y = betarnd(2,5,1,10000);
> hist(y,100);
>
> and I get the error:
>
> Warning: Input arguments must be scalar.
>> In randg at 18
> In betarnd at 34
> In Continuous1 at 5

Type the following command and rename or remove any instance of RANDG listed
in the output of that command that is not located in the Statistics Toolbox
directory:

which -all randg

You had another function named randg on your path that did not have the same
signature as the one from Statistics Toolbox and because it was higher on
the MATLAB path than the toolbox function, BETARND was using that version.

--
Steve Lord
slord(a)mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
To contact Technical Support use the Contact Us link on
http://www.mathworks.com