我的matlab版本是2009a,为什么help不到vpa函数?digits也help不到。而且help的document里也搜索不到啊。为什么?如果我想控制运算精度还有什么办法呢?
安装matlab的时候我把安装软件里的所有函数包都安上了。
matlab计算精度控制函数vpa
答案:1 悬赏:80 手机版
解决时间 2021-03-08 23:48
- 提问者网友:喧嚣尘世
- 2021-03-07 23:32
最佳答案
- 五星知识达人网友:怀裏藏嬌
- 2021-03-07 23:56
可以得到帮助。很有可能你的安装包不全。
>> help vpa
VPA Variable precision arithmetic.
R = VPA(S) numerically evaluates each element of the double matrix
S using variable precision floating point arithmetic with D decimal
digit accuracy, where D is the current setting of DIGITS.
The resulting R is a SYM.
VPA(S,D) uses D digits, instead of the current setting of DIGITS.
D is an integer or the SYM representation of a number.
It is important to avoid the evaluation of an expression using double
precision floating point arithmetic before it is passed to VPA.
For example,
phi = vpa((1+sqrt(5))/2)
first computes a 16-digit approximation to the golden ratio, then
converts that approximation to one with d digits, where d is the current
setting of DIGITS. To get full precision, use unevaluated string or
symbolic arguments,
phi = vpa('(1+sqrt(5))/2')
or
s = sym('sqrt(5)')
phi = vpa((1+s)/2);
Additional examples:
vpa(pi,780) shows six consecutive 9's near digit 770 in the
decimal expansion of pi.
vpa(hilb(2),5) returns
[ 1., .50000]
[.50000, .33333]
See also double, digits.
Overloaded methods:
sym/vpa
>> help digits
DIGITS Set variable precision digits.
Digits determines the accuracy of variable precision numeric computations.
DIGITS, by itself, displays the current setting of Digits.
DIGITS(D) sets Digits to D for subsequent calculations. D is an
integer, or a string or sym representing an integer.
D = DIGITS returns the current setting of Digits. D is an integer.
See also vpa.
>> help vpa
VPA Variable precision arithmetic.
R = VPA(S) numerically evaluates each element of the double matrix
S using variable precision floating point arithmetic with D decimal
digit accuracy, where D is the current setting of DIGITS.
The resulting R is a SYM.
VPA(S,D) uses D digits, instead of the current setting of DIGITS.
D is an integer or the SYM representation of a number.
It is important to avoid the evaluation of an expression using double
precision floating point arithmetic before it is passed to VPA.
For example,
phi = vpa((1+sqrt(5))/2)
first computes a 16-digit approximation to the golden ratio, then
converts that approximation to one with d digits, where d is the current
setting of DIGITS. To get full precision, use unevaluated string or
symbolic arguments,
phi = vpa('(1+sqrt(5))/2')
or
s = sym('sqrt(5)')
phi = vpa((1+s)/2);
Additional examples:
vpa(pi,780) shows six consecutive 9's near digit 770 in the
decimal expansion of pi.
vpa(hilb(2),5) returns
[ 1., .50000]
[.50000, .33333]
See also double, digits.
Overloaded methods:
sym/vpa
>> help digits
DIGITS Set variable precision digits.
Digits determines the accuracy of variable precision numeric computations.
DIGITS, by itself, displays the current setting of Digits.
DIGITS(D) sets Digits to D for subsequent calculations. D is an
integer, or a string or sym representing an integer.
D = DIGITS returns the current setting of Digits. D is an integer.
See also vpa.
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯