%This program corresponds to exercise 2 in sheet 1 and 
%deals with nested do loops
%inputs: n,m: maximum number of iterations 
function test2=x(n,m)
x=0;
for i=1:n
    for j=1:m
    x=x+(i-1)^j*i;
    end
end
disp('The output is:')
disp(x)
end