%% Lab 4: Loop Statements - Wednesday, 2016-02-17
% This script computes the average run time for Lab4 functions

num = 10;
iter = 10000;

%% With a for loop

rtime = 0;

for i=1:iter
    tic
    lab4_loop(num)
    rtime = rtime + toc;
end
fprintf('Average run time is %f\n', rtime/iter)


%% Without a for loop

rtime = 0;

for i=1:iter
    tic
    lab4_noloop(num)
    rtime = rtime + toc;
end
fprintf('Average run time is %f\n', rtime/iter) 
