From: fuaada on 7 Jun 2010 22:39 Hello, My generator for random poisson number is B = [0 2; 1.5 1.94 ; 2 1.97 ; 3 1.86 ; 3.5 1.91 ; 4.5 1.75 ; 5 1.73 ; 6 1.59 ; 7.5 1.37 ; 8.5 1.18 ; 9 1.16; 10.5 1.0885]; xdata=B(:,1); num=100;gamma=1; npoints=11; T=24; for i=1:npoints+1 X(:,i)=poissrnd((gamma*xdata(i)),1,num); end Here i want to fix the random number X everytime i run the code.....does anyone here know how to work it out......please Thanks in advance! Fuaada
From: Walter Roberson on 7 Jun 2010 23:08 fuaada wrote: > My generator for random poisson number is > > B = [0 2; 1.5 1.94 ; 2 1.97 ; 3 1.86 ; 3.5 1.91 ; 4.5 1.75 ; 5 1.73 ; > 6 1.59 ; 7.5 1.37 ; 8.5 1.18 ; 9 1.16; 10.5 1.0885]; > xdata=B(:,1); > num=100;gamma=1; > npoints=11; > T=24; > for i=1:npoints+1 > X(:,i)=poissrnd((gamma*xdata(i)),1,num); > end > > Here i want to fix the random number X everytime i run the > code. I do not understand what you mean about "fix the random number X everytime i run the code". If you are trying to repeat the random number stream, then you should see the documentation for @RandStream and randstream.create if you have 2008b or later, and rand() or randn() [not sure which poissrnd uses internally] if you have an earlier version.
From: fuaada on 21 Jun 2010 08:11 Yes, basically i want to repeat the same number for poissrnd...okay i will try to see the documentations.....thanks for your suggestion! Fuaada
|
Pages: 1 Prev: How to output dydt while using dde solver? Next: How to delete an element from cell |