vpa() examples not working in R2020a
26 次查看(过去 30 天)
显示 更早的评论
I saw that the vpa(x,d) function wasn't working as intended so I tried the examples in https://www.mathworks.com/help/symbolic/vpa.html.
They did not work either:
>> clear all
>> digits
Digits = 32
>> syms x
p = sym(pi);
piVpa = vpa(p)
piVpa =
3.1416
>> vpa(pi,100)
ans =
3.1416
According to the documentation, I should have gotten
piVpa =
3.1415926535897932384626433832795
and
vpa(pi,100)
ans =
3.141592653589793238462643383279502884197169...
39937510582097494459230781640628620899862803...
4825342117068
As you can see, I started my code with
clear all
so I do not know what the problem is.
3 个评论
Ameer Hamza
2020-9-16
编辑:Ameer Hamza
2020-9-16
Can you show the output of
which vpa -all
Run this in command window.
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Numbers and Precision 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!