title: Evaluating a symbolic summation in MATLAB
body: <p>Following code throws out an error.</p>
  
  <pre><code>syms z positive;
  syms n;
  syms m;
  N = 10;
  Ms = 10;
  Es = 1;
  pd = 0.9;
  pd_dash = 1-pd;
  pf = 0.1;
  pf_dash = 1-pf;
  pr = 0.1;
  qr = 1-pr;
  p = 0.005
  pi = pf_dash*p;
  pb = pd_dash*p;
  qi = 1-pi;
  qb = 1-pb;
  
  sm = symsum( z^((n+1)*Es), n, 0, N-1 );
  temp_sum = symsum(z^((n+m+1)*Es)*qr^(n+m)*pr, m, 0, N-1);
  
  z=1; %assume a value of z
  x = eval(sm); %works fine
  y = eval(temp_sum);
  % Error:The expression to the left of the equals sign is not a valid target for an assignment.
  </code></pre>
  
  <p>Please suggest a way to resolve this.</p>
  
  <p>The problem that I suspect is: the temp_sum comes out to be in piecewise(...) which eval is not capable of evaluating.</p>