randsrcwith MATLAB picks random items from an alphabet but does not make sure that the picks are unique. If you need uniqueness and your alphabet is the set of integers between 1 and
limit, here's a very simple way to do it:
[temp A] = sort(rand(1,limit),2);
Acontains a random ordering of integers from 1 to
limit. The idea is to generate uniformly distributed random numbers between 0 and 1, sort them and get the sorted indices. Very simple.
PS: I got this idea from here.