网站制度建设模板,福田蒙派克柴油版7座,做购物车的网站,公司介绍信模板符号运算得到的是精确的解析解#xff0c;但是有时需要进行数值转换#xff0c;主要通过以下几个函数实现。1.digits 函数调用方法#xff1a;digits(D)函数设置有效数字个数为D的近似解精度。2.vpa 函数vpaVariable-precision arithmeticSyntaxR vpa(A)R vpa(A,d)Descrip…符号运算得到的是精确的解析解但是有时需要进行数值转换主要通过以下几个函数实现。1.digits 函数调用方法digits(D)函数设置有效数字个数为D的近似解精度。2.vpa 函数vpaVariable-precision arithmeticSyntaxR vpa(A)R vpa(A,d)DescriptionR vpa(A) uses variable-precision arithmetic (VPA) to computeeach element of A to at least d decimal digits of accuracy, where dis the current setting of digits.R vpa(A,d) uses at least d significant (nonzero) digits,instead of the current setting of digits.注vpa中的精度是指有效值即vpa(1.2345,2)1.2vpa(0.2345,2) 0.233.subs函数subsSymbolic substitutionSyntaxg subs(f,old,new)g subs(f,new)g subs(f)g subs(f,old,new,0)Descriptiong subs(f,old,new) replaces all occurrences of old with new inf, and then evaluates f.g subs(f,new) replaces all occurrences of the default variablein f (defined by symvar) with new , and then evaluates f.g subs(f) replaces symbolic variables in f with their valuesobtained from the calling function and the MATLAB workspace, andthen evaluates f. Variables with no assigned values remain asvariables.g subs(f,old,new,0) prevents switching the arguments old andnew if subs(f,old,new) returns f. Without this additional argument,the toolbox also tries subs(f,new,old) if subs(f,old,new) returnsf. This approach provides backwards compatibility with previousversions and eliminates the need to remember the order of thearguments.例1求方程3*x^2-exp(x) 0 的精确解和各种精度的近似解 s solve(3*x^2-exp(x) 0)s -2*lambertw(0, 3^(1/2)/6)-2*lambertw(0, -3^(1/2)/6) vpa(s)ans -0.458962267536948514598572432434060.91000757248870906065733829575937 vpa(s,6)ans -0.4589620.910008例2设函数为f(x) x – cos(x) 。求此函数在x pi点的值的各种精度的数值近似形式。 x sym(x); f x - cos(x)f x - cos(x) f1 subs(f,x,pi)f1 4.1416