From: Otis Luo on 29 Mar 2010 04:51 Hi, how to generate random float number in a fixed range, such as between 70 to 80.
From: us on 29 Mar 2010 05:03 "Otis Luo" <luowei86(a)gmail.com> wrote in message <hopplq$9lt$1(a)fred.mathworks.com>... > Hi, how to generate random float number in a fixed range, such as between 70 to 80. one of the solutions hi=80; lo=70; nr=100000; r=lo+(hi-lo)*rand(1,nr); disp([min(r);max(r)]); %{ 70 80 %} us
From: Otis Luo on 29 Mar 2010 05:09 "us " <us(a)neurol.unizh.ch> wrote in message <hopqc9$k35$1(a)fred.mathworks.com>... > "Otis Luo" <luowei86(a)gmail.com> wrote in message <hopplq$9lt$1(a)fred.mathworks.com>... > > Hi, how to generate random float number in a fixed range, such as between 70 to 80. > > one of the solutions > > hi=80; > lo=70; > nr=100000; > r=lo+(hi-lo)*rand(1,nr); > disp([min(r);max(r)]); > %{ > 70 > 80 > %} > > us thank u, i got it
|
Pages: 1 Prev: quadratic surface Next: Mex-file unable to be identified by MCC generated Exe file |