MATLAB: Vpa() examples not working in R2020a

errorMATLABprecisionsignificant figuressignificant-digitsvpa

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.

Best Answer

Try:
sympref('default');
.