Simplifying results from rat function

4 次查看(过去 30 天)
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

采纳的回答

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

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Assumptions 的更多信息

产品


版本

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by