![]() The core of rat generates continued fractions by repeatedly subtracting off the integer part and taking the reciprocal of what is left. So, we don't have much use for rat and format rat today, but they're still there and, as I said, they're moderately controversial. Besides, most important MATLAB calculations involve larger matrices, and eigenvalues, differential equations and signal processing. Don't try to hide itīut I have learned that it is better to explain floating point arithmetic than it is to try to hide it. For this example, almost everybody would vote for the rational format. Or the second, printed with a rational format that seeks to disguise the roundoff. ![]() Which version of X do you prefer? The first, printed with a floating point format so the roundoff errors are readily apparent. Let's try that second example with modern MATLAB and format rat. B = RAT(X) Some examples: longĭ = 1:8, e = ones(d), A = abs(d'*e - e'*d) + 1/dk)) with k = RAT(X) produces integer matrices A and B so that A. RAT(X) approximates each element of X by a continuedįraction of the form a/b = d1 + 1/(d2 + 1/(d3 +. Roundoff error from results that should be "simple" Help rat RAT An experimental function which attempts to remove the Here is the help entry from 40 years ago. ![]() It was one of the 73 functions in my original Fortran MATLAB. The function rat is older than MathWorks.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |