title: Implementing Neville's Algorithm in MatLab
body: <p>I'm attempting to implement Neville's algorithm in MatLab with four given points in this case. However, I'm a little stuck at the moment. 
  This is my script so far:</p>
  
  <pre><code>% Neville's Method
  
  % Function parameters
  x = [7,14,21,28];
  fx = [58,50,54,53];
  t = 10;
  
  n = length(x);
  Q = zeros(n,n);
  
  
  for i = 1:n
      Q(i,1) = fx(i);
  end
  for j = 2:n
      for i = j:n
          Q(i,j) = ((t-x(i-j)) * Q(i,j-1)/(x(i)-x(i-j))) + ((x(i)-t) * Q(i-1,j-1)/(x(i)-x(i-j)));
      end
  end
  
  print(Q);
  </code></pre>
  
  <p>As for the problem I'm having, I'm getting this output consistently:
  <strong>Subscript indices must either be real positive integers or logicals.</strong></p>
  
  <p>I've been trying to tweak the loop iterations but to no avail. I know the problem is the primary logic line in the inner loop. Some of the operations result in array indices that are equal to zero initially.</p>
  
  <p>That's where I am, any help would be appreciated!</p>