title: MATLAB issue For
body: <p>Calculate the periodogram, using the variables <code>a</code> and <code>b</code>, for a sequence of frequencies <code>f</code>, between 1 and 20, with intervals of 0.2. For each frequency value, find the values, through the equation</p>
  
  <pre><code>T = (1/(4*pi*f))*atan(sum(sin(4*pi*f*t(i))))/(sum(cos(4*pi*f*t(i))) 
  </code></pre>
  
  <p>Then, calculate the value of the periodgram for the frequency <code>f</code>, <code>P(f)</code>, through the equation:</p>
  
  <pre><code>P(f) = ((sum(MasterYi(i)*sin(2*pi*f(t(i)-T))))^2)/(sum(sin^2(2*pi*f(t(i)-T))))+... ((sum(MasterYi(i)*cos(2*pi*f(t(i)-T))))^2)/(sum(cos^2(2*pi*f(t(i)-T)))) 
  </code></pre>
  
  <p>Where, </p>
  
  <pre><code>MasterYi = a * sin(2*pi*f(ti-T))+b*cos(2*pi*f(ti-T)) 
  </code></pre>
  
  <p>I have this code:</p>
  
  <pre><code>for f = 1:0.2:20
  %t is a value that we know
  t = 1:82;
  T(:,f) = (1./(4*pi.*f)).*tan(sum(sin(4*pi*f*t(:,f))))./(sum(cos(4*pi*f.*t(:,f))))
  
  end
  </code></pre>
  
  <p>At the moment we are just trying to get the values for <code>T</code>, but it says:</p>
  
  <blockquote>
    <p>index must be real positive integers or logicals.</p>
  </blockquote>