vpa() examples not working in R2020a
17 views (last 30 days)
Show older comments
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 Comments
Ameer Hamza
on 16 Sep 2020
Edited: Ameer Hamza
on 16 Sep 2020
Can you show the output of
which vpa -all
Run this in command window.
Accepted Answer
More Answers (0)
See Also
Categories
Find more on Numbers and Precision in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!