function y = polynomial(a,x)
%please put the code here to compute the required result. 
%You're allowed to use a 'for' loop to go through the 'a' vector


%Here, we use a very general technique known as 'accumulation': 
%	1- We initialize the vector y to be a zero-filled vector of
%	the same size as x
%	2- We 'accumulate' (i.e. repeatedely add) the term of
%	order n-i
y = zeros(size(x));
n = length(a);
for i=1:n
  y = y + a(i) * x.^(n-i);
end


