Given the simple nature of my particular IRR calculation, I figured it would be easy enough to simply code in matlab. It is the same yearly cashflow, so what I put into matlab was as follows:
[code]syms x k;
IRR = solve(investment == yrSavings* symsum((1+x)^-k,1, nYears));[/code]
It doesn't fail, and in fact gives a number. The only problem is the the result is incorrect! I type in the IRR manually and it never equals the investment. Using wolframalpha I found the actual solution, went back and manually typed in wolframalpha's answer, and the symsum function returned the correct result. I'm not sure what's up with the solver!
[/code]
Read More:[code]syms x k; IRR = solve(investment == yrSavings* symsum((1+x)^-k,k,1, nYears));[url=http://www.theengineeringprojects.com/2014/12/financial-calculations-in-matlab.html]FINANCIAL CALCULATIONS IN MATLAB