Open in the MATLAB editor: g01an_example
function g01an_example fprintf('g01an example results\n\n'); n = int64(60); tol = 0.2; q = [0.25 0.5 1.0]; rv = { ... [34.01, 57.95, 44.88, 22.04, 28.84, 4.43, 0.32, 20.82, ... 20.53, 13.08, 7.99, 54.03, 23.21, 26.73, 39.72, 0.97], [39.05, 38.78, 19.38, 51.34, 24.08, 12.41, 58.11, 35.90, ... 40.38, 27.41, 19.80, 6.02, 45.33, 36.34, 43.14, 53.84 , ... 39.49, 9.04, 36.74, 58.72, 59.95, 15.41, 33.05, 39.54], [33.24, 58.67, 54.12, 39.48, 43.73, 24.15, 55.72, 8.87], [40.47, 46.18, 20.36, 6.95, 36.86, 49.24, 56.83, 43.87, ... 29.86, 22.49, 25.29, 33.17] ... }; % First call to obtain lengths of communication arrays ind = int64(0); icomm = zeros(2, 1, 'int64'); [ind, np, qv, rcomm, icomm, ifail] = ... g01an(ind, n, 0, tol, q, 0, icomm); % Allocate communication arrays rcomm = zeros(icomm(1), 1); icomm = zeros(icomm(2), 1, 'int64'); for i=1:numel(rv) % Repeat call for every dataset block in rv. [ind, np, qv, rcomm, icomm, ifail] = ... g01an(ind, n, rv{i}, tol, q, rcomm, icomm); end % Call again to calculate quantiles q ind = int64(3); [ind, np, qv, rcomm, icomm, ifail] = ... g01an(ind, n, 0, tol, q, rcomm, icomm); % Display results fprintf('\nInput Data:\n %d observations\n eps = %5.2f\n\n', n, tol); fprintf('Quantile Result\n'); fprintf('%7.2f %7.2f\n', [q; qv']);
g01an example results Input Data: 60 observations eps = 0.20 Quantile Result 0.25 22.49 0.50 36.86 1.00 59.95