num2cf
- :
a =num2cf(x)¶ - :
a =num2cf(x, n)¶ Continued-fraction coefficients of the real scalar x.
Returns the simple continued-fraction partial quotients
[a0; a1, a2, …]as a row vector, using the floor map a_k = floor(r_k), r_{k+1} = 1/(r_k - a_k). With one argument at most 20 terms are produced (stopping early when the remainder is exact). With n, at most n terms are returned.Output class is
singlewhen x is single, otherwisedouble.Behaviour note (MATLAB R2026a): MathWorks does not ship
num2cfin R2026a (which/helpmiss; absent fromtoolbox/matlab/specfunandelfun). Nexus provides this name for next-wave math-012 (nexus#1861). Golden check: the first four coefficients ofpiare[3, 7, 15, 1], whose convergents include 22/7 and 355/113.