title: I am studying a code which creates a row vector A based on polynomial function (8x+3x^2+3x^3) mod N
body: <pre><code>coeff = [8 3 3];  %%poly_function 
  A = []; N=9;
  for ix = 1:N;
      c = 0;
  for i = 1:3
      temp=1;
      for k=1:i
          temp=mod(temp*ix,N);
      end
      c = c + mod(coeff(i)*temp ,N);
      c = mod(c, N);
      if c == 0; c = N; end
  end
  A = [A c]; %%A = [5 7 6 2 4 3 8 1 9]
  end
  </code></pre>
  
  <p>I'm a bit confused about how this loop works to get result A. 
  Why  is A  defined as A= [ ]; and in the end are A and c merged? </p>
  
  <p>Could you please help me understand the working of this code?</p>