Open in the MATLAB editor: g05ne_example
function g05ne_example fprintf('g05ne example results\n\n'); genid = int64(3); subid = int64(0); seed = [int64(1762543)]; % Initialise the generator to a repeatable sequence [state, ifail] = g05kf( ... genid, subid, seed); % Data to sample with weights ipop = [int64(171); 52; 172; 139; 196; 125; 36; 70; 25; 86; 76; 37; 185; 40; 90; 27; 79; 118; 142; 127; 101; 22; 41; 199; 59]; wt = [ 85.54; 71.78; 118.13; 13.68; 153.60; 165.35; 122.35; 35.87; 151.78; 128.33; 178.27; 183.37; 165.81; 101.41; 145.16; 42.01; 59.08; 17.53; 87.14; 69.20; 31.13; 60.26; 21.00; 85.06; 119.73]; % Generate the sample sice m without replacement, unequal weights m = int64(10); pop = 's'; order = 'u'; [isampl, state, ifail] = g05ne( ... order, wt, pop, ipop, m, state); % Display the results disp(isampl);
g05ne example results 125 41 185 40 37 196 22 25 76 172