MATLAB: How to select randomly 30 numbers from 108 and maintain uniqueness

MATLABnumbersrandomunique

Hello,
I need to select 30 numbers randomly from 108. I need also that the values are unique.
My approach so far:
allpeople = [];
for person = 1:108
allpeople(person) = person;
end
for i = 1:30
nrpeople(i) = randi(length(allpeople));
end
But this doesn't produce unique numbers

Best Answer

randperm(108,30)
or let A - your data array 108 x 1
aa = unique(A);
out = aa(randperm(numel(aa),30));