title: 'invalid iteration specific' error on Julia
body: <p>I'm trying to implement the MUSIC algorithm and I chose Julia to write my code.  </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>DOA=ones(1,rand(1:10))
   for i in 1:length(DOA)
      DOA[1,i]=rand(0:1000)*pi/180;
   end
   sensors=11;
   freq=ones(1,length(DOA[1,:]))
   for i in 1:length(DOA)
     freq[1,i]=rand()*pi*100;
   end
   signals=length(DOA);
   lambda=100;
   dist=lambda/2;
   A=zeros(signals,sensors);
   snr1=rand(20:40);
   N=200;
   x=zeros(length(freq),N);
   for j = 1:length(freq), for k = 1:signals
      x[j,k]=2*exp(im*freq[j]*k);
   end
   for l = 1:signals, for m = 1:sensors
      A[l,m]=exp(-im*2*pi*dist*sin(DOA[1,l])*m/lambda));
   end</code></pre>
  </div>
  </div>
  </p>
  
  <p>So <code>for j = 1:length(freq), for k = 1:signals</code> shows no error but the one after, <code>for l = 1:signals, for m = 1:sensors</code>, keeps showing the 'invalid iteration specification' error.<br>
  My novice tries include, commenting the for loop, deleting it completely and giving spaces in between just to see what was going on. Surprisingly, even after I saved the file numerous times and started a new bash session it showed me the same error for a commented for loop and blank spaces. Any ideas about tackling this problem? Or better yet, what can cause such errors? I've attached a screenshot too for the specifics, line 38 being the for loop with the error. </p>
  
  <p><img src="https://i.stack.imgur.com/uQr5P.png" alt="I&#39;ve attached a screenshot too for the specifics, line 38 being the for loop with the error."> </p>