vpa
Variable precision arithmetic
变量精度计算
Syntax
R =vpa(A)
R =vpa(A, d)
Description
R =vpa(A)uses variable-precision arithmetic (VPA) to compute each element ofAtoddecimal digits of accuracy, wheredis the current setting ofdigits. Each element of the result is a symbolic expression_r.
R =vpa(A, d)usesddigits, instead of the current setting ofdigits.
R =vpa(A)利用变量精度计算方法以d为小数点精度去计算A中的每个元素,其中d是当前的小数点设置(digits).每个输出的元素是符号表达式.
R =vpa(A, d)利用d为digits精度代替当前的digits设置.(其实就是小数点后的位数)
Examples
The statements
digits(25) q =vpa(sin(sym('pi')/6)) p =vpa(pi) w =vpa('(1+sqrt(5))/2')
return
q = 0.5 p = 3.141592653589793238462643w = 1.618033988749894848204587
vpapi 75computesπto75digits.
The statements
A =vpa(hilb(2),25) B =vpa(hilb(2),5)
return
A = [ 1.0, 0.5] [ 0.5, 0.3333333333333333333333333] B = [ 1.0, 0.5] [ 0.5, 0.33333]
matlab错误提示
The following error occurred converting from sym to double:
Error using mupadmex
Error in MuPAD command: DOUBLE cannot convert the input expression into a double array.
If the input expression contains a symbolic variable, use the VPA function instead.
Error in hRefinement2d (line 103)
newprojcoord(wcpindex,:) = tempcontrolPoints;