% Script for execution with BATCH command
% >> job = batch('example1_batch');
% try the following until it returns 'finished'
% >> get(job, 'state')
% then process the output 
% >> vars = load(job, 'a');
% >> hist(vars.a)

time = clock;

% adjust m and N according to your resources 
N = 2000; 
m = 50; 
a = zeros(N,1); 
seeds = (1:N);

parfor I = 1:N 
    a(I) = largestEigenvalue(m,seeds(I)); 
end
hist(a)