title: Matlab To Python conversion: SyntaxError: cannot assign to function call
body: <p>This is my MATLAB code it runs fine.</p>
  <pre><code>% all of the given time are in milisecond
  n = 3;     % No of image
  T = 100;   % for the time period user wants to see the mirage
  
  ts = .2*(100/(2*n-3));     % standing time
  tv = .6*((100-((2*n-3)*ts))/(2*(n-1)));     % travelling time
  
  m1 = 0:.1:tv;
  x1 = .5*(1-cos(pi*(m1/tv)));      %position equation
  xa = x1;
  
   
  %travelling toward from left to right
  for i= 1:n-1
      x1 = x1+i-1;
      %standing at one point
      for f = 1:ts
          x2(f) = x1(end);
      end
      if i==1
          x3=[x1,x2];
      else
          x3 = [x3,x1,x2];
      end
   
  end
  </code></pre>
  <p>I'm trying to turn it into Python code. <strong>It shows SyntaxError: cannot assign to function call</strong><br />
  This is Python code I came up with</p>
  <pre><code>import numpy as np
  import math 
  n = 3;                          
  T = 100;                                          
  ts = .2*(100/(2*n-3));                              
  tv = .6*((100-((2*n-3)*ts))/(2*(n-1)));
  m1 =   np.arange(0,tv,0.1); 
  x1 = 0.5*(1-(np.cos(np.pi*(m1/tv)))); 
  xa = x1;
  
  ##################################
  
  
  #travelling toward from left to right
  for i in range(1,n-1):
      x1 = x1+i-1;
      for f in np.arange(1,ts, ):     
          x2(f) = x1(end);            # The error line
          if i==1:
              x3 = np.array([x1,x2]);
          else:
              x3 = np.array([x3,x1,x2]);              
          
  </code></pre>
  <p>How can I fix this? what changes can I make in the x2(f) = x1(end) because whatever I do it shows different error every time.</p>