MATLAB: How to get improper fraction representation from rat(x,tol) function

rational

Dear matlab forum,
Hello. the rat(x,tol) function outputs a string of a continued fraction, for example '5+1/(7+1/4)'. How can I condense this into an improper fraction of only one numerator and denominator?

Best Answer

[N,D] = rat(x,tol);