| Symbolic Math Toolbox | Search  Help Desk | |
| vpa | Examples | See Also |
Variable precision arithmetic.
R = vpa(A) R = vpa(A,d)
vpa(A) uses variable-precision arithmetic (VPA) to compute each element of A to d decimal digits of accuracy, where d is the current setting of digits. Each element of the result is a symbolic expression.
vpa(A,d) uses d digits, instead of the current setting of digits.
The statements
digits(25)returnq = vpa(sym(sin(pi/6)))p = vpa(pi)w = vpa('(1+sqrt(5))/2')
q = .5000000000000000000000000 p = 3.141592653589793238462643 w = 1.618033988749894848204587
vpa pi 75 computes
to 75 digits.
The statements
A = vpa(hilb(2),25)
B = vpa(hilb(2),5)
return
A = [ 1., .5000000000000000000000000] [.5000000000000000000000000, .3333333333333333333333333] B = [ 1., .50000] [.50000, .33333]
digits, double