Code covered by the BSD License  

Highlights from
RANDSUBSET

from RANDSUBSET by Bruno Luong
Return a random subset of k elements of the set of n elements

randsubset_install
function randsubset_install
% function randsubset_install
% Installation by building the C-mex files for randsubset filter package
%
% Author Bruno Luong <brunoluong@yahoo.com>
% Last update: 24-Jun-2010

arch=computer('arch');
mexopts = {'-O' '-v' ['-' arch]};
% 64-bit platform
if ~isempty(strfind(computer(),'64'))
    mexopts(end+1) = {'-largeArrayDims'};
end

% invoke MEX compilation tool
mex(mexopts{:},'rssfloyd.c');

Contact us at files@mathworks.com