we know that Pell equation is expressed as
which in case of D is not perfect square, can be approximated by continued fraction expansion of D, for instance let us consider such kind of equation
square root of 61 can be approximated by following matlab code
>> b=sqrt(61);
>> format rat
>> b
b =
1523/195
but i have question : how can i assign result in two separate variable ?namely
x=1523
y=195
from this site https://www.quora.com/What-is-the-fast-way-to-solve-the-fundamental-solution-of-Pell-equation
i understood that solution are based on numerator and denumerator, how can i assign fraction parts to x and y during the code in matlab? thanks in advance