title: Solving a system with two equations and two variables in a for loop
body: <p>I would like to solve a system with two equations and two variables.<br>
   <code>Tau(i)</code>and  <code>Roh(i)</code> are input arrays.</p>
  
  <p><code>Tau=[0.91411 0.91433 0.91389 0.91399 0.91511 0.915]</code><br>
  <code>Roh=[0.07941 0.07942 0.07952 0.07946 0.07951 0.07947]</code></p>
  
  <p>I would like to calculate <code>R(i)</code>and <code>t(i)</code>for each <code>i</code>step (for loop).
  I will be glad to have help to solve the equations.
  <a href="https://i.stack.imgur.com/CEnQR.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CEnQR.jpg" alt="enter image description here"></a>    </p>
  
  <p><code>Tau(i)-((1-R(i))^2*t(i))/(1-R(i)^2*t(i)^2)==0</code><br>
  <code>Roh(i)-R(i)-((1-R(i))^2*R(i)*t(i)^2)/(1-R(i)^2*t(i)^2)==0</code></p>
  
  <p>I have tried the following script but I have difficulty to write the proper code to export the data. I get only "sym" which is not a value.</p>
  
  <pre><code>function [R,t] = glassair(Tau, Roh)
  
  for i=1:6
      syms R(i) t(i)
       eq1(i)=sym('Tau(i)-((1-R(i))^2*t(i))/(1-R(i)^2*t(i)^2)');
       eq2(i)=sym('Roh(i)-R(i)-((1-R(i))^2*R(i)*t(i)^2)/(1-R(i)^2*t(i)^2)');
       sol(i)=solve(eq1(i),R(i), eq2(i),t(i));
  
  end
  end
  </code></pre>