how to covert a log number into nature number?
이전 댓글 표시
I have an answer poped up like this below:
log(5^(1/2) + 2)/4 + 5^(1/2)/2
How can I convert it into a nature number?
Thanks
답변 (2개)
James Tursa
2018년 10월 1일
편집: James Tursa
2018년 10월 1일
I'm assuming this is the result of some symbolic manipulation? Try converting it to double:
result = double( your expression result );
E.g.,
>> log(sqrt(sym(5)) + 2)/4 + sqrt(sym(5))/2
ans =
log(5^(1/2) + 2)/4 + 5^(1/2)/2
>> double(ans)
ans =
1.4789
You can get the approximate fractions using rat:
[num,den] = rat(log(5^(1/2) + 2)/4 + 5^(1/2)/2)
yields 1791/1211 which is about 1.47894
You can also specify a tolerance, if you accept a larger error
[up,down] = rat(log(5^(1/2) + 2)/4 + 5^(1/2)/2,0.1)
gives 3/2
카테고리
도움말 센터 및 File Exchange에서 Numbers and Precision에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!