function [numHeads]=monteCarloFunction(N,nCoins)
%  This example involves running a 
%  monte-carlo simulation that produces 
%  an integer from 1 to 20.  We want to
%  display a histogram of the result.

% Copyright 2008 The MathWorks, Inc.

numHeads = zeros(1, N);

parfor (simNum = 1:N)
     numHeads(simNum) = flipCoins(nCoins,simNum);
end





