<p>I’m figuring someone on this board knows how to do this. </p>
<p>I’m trying to write code to solve an infinite series and getting hung up with the solver. Basically I want to take a variable I defined earlier, construct a single variable equation with it, then solve for the variable. But as far as I can see, the solver only accepts strings like:</p>
<br>
<br>
<p>but</p>
<br>
<br>
<p>doesn’t work.</p>
<p>What I’m trying to do is write to do is solve the series iteratively, by solving with n terms, then n+1 terms, comparing the solutions and seeing if the difference is negligible, so I have to rebuild the equation each time. But to do this, I need to use previously defined code that calculate what the n,n+1, n+2 terms are.</p>
<p>I think this is just me not knowing some basic process in Matlab. If anyone can clue me in on how to use previously defined variables, or another way to write the code, I’d appreciate it.</p>