Simplifying results from rat function

1 vue (au cours des 30 derniers jours)
Ken Bannister
Ken Bannister le 19 Jan 2022
Suppose I have found the decimal value:
0.642857142857143
Which by the way I know to be 9/14
if I go:
result =rat(0.642857142857143)
I get the interesting symbolic output:
'1 + 1/(-3 + 1/(5))'
How do I now go about turning this symbolic numerical expression into something
like '9/14' ?
I thought maybe simplifyFraction would suffice, but looks like that is reserved for algebraic espressionss

Réponse acceptée

Walter Roberson
Walter Roberson le 19 Jan 2022
[N,D] = rat(0.642857142857143)
N = 9
D = 14

Plus de réponses (0)

Catégories

En savoir plus sur Symbolic Math Toolbox dans Help Center et File Exchange

Produits


Version

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by