Re: set variable to random number.and change i=MEnum to i<=MEnum
Re: set variable to random number.I would do it this way
beta = {};
MEnum = 5;
for (i=1, I<=MEnum,i++,
beta[i] = Random uniform. (30,50);
);
Re: set variable to random number.Nevermind, I took out your period and it works. I copied without paying attention. thank you!
set variable to random number.I want to set variables to random numbers. I tried this. but it is not working
MEnum = 5;
For( i = 1, i = MEnum, i++,
betai = Random uniform.( 30, 50 )
);
When I print this to the log it just keeps giving me random numbers, how do I get 5 different random numbers for beta1 to beta5?
ScriptingRe: set variable to random number.I tried
beta = {};
For( i = 1, i <= MEnum, i++,
beta[i] = Random uniform.( 30, 50 );
Print( betai );
);
MEnum is based on how many columns are selected. I checked this out and it is working.
but I get this error:
Name Unresolved: Random uniform. in access or evaluation of 'Random uniform.' , Random uniform.( 30, 50 ) /*###*/
Re: set variable to random number.I tried
beta = {};
For( i = 1, i <= MEnum, i++,
beta[i] = Random uniform.( 30, 50 );
Print( betai );
);
MEnum is defined above all this and is working fine.
But I am getting this error:
Name Unresolved: Random uniform. in access or evaluation of 'Random uniform.' , Random uniform.( 30, 50 ) /*###*/
Re: set variable to random number.Very nice lesson, @txnelson . I would also offer this way:
beta = J( MEnum, 1, Random Uniform( 30, 50 ) );