Code covered by the BSD License  

Highlights from
Discriminant Analysis Programme

image thumbnail
from Discriminant Analysis Programme by Bartolomeu Rabacal
Discrimination and Classification of data to and from groups with classical/robust estimation

randomset(tot,nel,seed)
function [ranset,seed] = randomset(tot,nel,seed)

% This function is called if not all (p+1)-subsets out of n will be 
% considered. It randomly draws a subsample of nel cases out of tot.      

for j=1:nel
    [random,seed] = uniran(seed);       
    num = floor(random*tot)+1;
    if j > 1
        while any(ranset==num)
            [random,seed] = uniran(seed);       
            num = floor(random*tot)+1;
        end   
    end
    ranset(j) = num;
end


%-----------------------------------------------------------------------  

Contact us at files@mathworks.com