From: Kishore on
Hello,
I need to generate n random symbols from the foloowing
I have 4 symbols a) (1,0) b) (-1,0) c) (0,3) d) (0,-3).

Which command do i need to use for this.

I used randsrc(), but how should the alphabet parameter be passed [1,0,-1,3,-3] will generate all possible combinations...But i need only the above a,b c and d symbols.


Thanks!.
From: Stefano on
if the symbols can be complex:

randsrc(m,1,[1,-1,3i,-3i]);

or if they must be real vectors:

c=[1 0; -1 0; 0 3; 0 -3];
c(1+floor(4*rand(m,1)),:);


"Kishore " <kishore3385(a)yahoo.co.in> wrote in message <hcte7v$i42$1(a)fred.mathworks.com>...
> Hello,
> I need to generate n random symbols from the foloowing
> I have 4 symbols a) (1,0) b) (-1,0) c) (0,3) d) (0,-3).
>
> Which command do i need to use for this.
>
> I used randsrc(), but how should the alphabet parameter be passed [1,0,-1,3,-3] will generate all possible combinations...But i need only the above a,b c and d symbols.
>
>
> Thanks!.
From: Kishore on
Thank you!