From: fuaada on
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
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
Yes, basically i want to repeat the same number for poissrnd...okay i
will try to see the documentations.....thanks for your suggestion!


Fuaada