MATLAB: Converting symbolic expression into double.

convert

When I perform a series of functions, the result is:
1.009168*rS + 0.25*rS*dcellCurrent(1) + 0.157*rS*dcellCurrent(2) + 0.057*rS*dcellCurrent(3) – 0.002*rS*dcellCurrent(4) – 0.093*rS*dcellCurrent(5) – 0.145*rS*dcellCurrent(6) – 0.197*rS*dcellCurrent(7) – 0.232*rS*dcellCurrent(8) – 0.313*rS*dcellCurrent(9) … *exp((120843*iSat*rSh)/(3125*n)))/(3125*n*exp((120843*rSh*dcellCurrent(13))/(3125*n))))
The expression is extremely long, I cut out a good bit of its innards so it would be viewable here. When I copy and paste the expression that it shows into the command window, the result is this number: 13.076812258420913
I know that I can just copy and paste it, but I would like to use logical expressions in an if statement, and I need to convert the expression in code because I would not like to do it by hand. How should I go about converting?

Best Answer

doc double
double(sym_expr)
and
doc subs