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

jonas
jonas 2018년 10월 1일
편집: jonas 2018년 10월 1일
nature number? You want to express the results as a fraction?
gao peter
gao peter 2018년 10월 2일
Hi Jonas,
yes, i would like to convert it into fractions. could you show me how to do it?
Thanks

댓글을 달려면 로그인하십시오.

답변 (2개)

James Tursa
James Tursa 2018년 10월 1일
편집: James Tursa 2018년 10월 1일

0 개 추천

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
jonas
jonas 2018년 10월 2일
편집: jonas 2018년 10월 2일

0 개 추천

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

카테고리

질문:

2018년 10월 1일

편집:

2018년 10월 2일

Community Treasure Hunt

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

Start Hunting!

Translated by