필터 지우기
필터 지우기

Use of vpa results

조회 수: 1 (최근 30일)
Dmytro
Dmytro 2011년 11월 1일
Hello,
Using vpa, I can get, for example
>> p=vpa('1/3',50)
p =
0.33333333333333333333333333333333333333333333333333
However, when I try to use the obtained value, precision is lost:
>> vpa(p/3,50)
ans =
0.11111111111111111111111111111111
How can I manipulate with such results without loosing precision? I tried many methods, but no one works:(
Thank you very much for your help!
Dima
  댓글 수: 1
Dmytro
Dmytro 2011년 11월 1일
I discovered, that problem can be solved by specifying first
digits(50)
Probably, it uses specified digits precision before using precision specified in vpa(...,50) in such cases.
Thank you for your answer, I found solution immediately after this!)

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

답변 (1개)

Walter Roberson
Walter Roberson 2011년 11월 1일
I would experiment with
vpa(subs('P/3','P',p),50)
Also, perhaps
vpa(p/sym(3),50)
  댓글 수: 1
Dmytro
Dmytro 2011년 11월 1일
Thank you for your answer. However, it does not work:( I will be very grateful for any further suggestions how to tackle this problem.

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by