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.

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

  如:若把b=vpa(0.1666)的结果转换为字符串,可以先将其转换为double类型,即double(b),再num2str(b),即得所需结果。

MATLAB中digits和vpa的更多相关文章

  1. Matlab中的数据类型

    Matlab中有15种基本数据类型,主要是整型.浮点.逻辑.字符.日期和时间.结构数组.单元格数组以及函数句柄等.         1.整型:(int8:uint8:int16:uint16:int3 ...

  2. matlab中help所有函数功能的英文翻译

    doc funname 在帮助浏览器中打开帮助文档 help funname 在命令窗口打开帮助文档 helpbrowser 直接打开帮助浏览器 lookfor funname 搜索某个关键字相关函数 ...

  3. MATLAB中的积分运算

    MATLAB中计算一元函数的(不)定积分使用int函数. ①int(s)计算符号表达式s的不定积分 syms x;s = x^2;int(s) 计算x^2的不定积分. ②int(s,x)计算符号表达式 ...

  4. MATLAB中绘制质点轨迹动图并保存成GIF

    工作需要在MATLAB中绘制质点轨迹并保存成GIF以便展示. 绘制质点轨迹动图可用comet和comet3命令,使用例子如下: t = 0:.01:2*pi;x = cos(2*t).*(cos(t) ...

  5. matlab 中 eps 的分析

    eps(a)是|a|与大于|a|的最小的浮点数之间的距离,距离越小表示精度越高.默认a=1: 这里直接在matlab中输入:eps == eps(1)(true). 我们知道浮点数其实是离散的,有限的 ...

  6. matlab中patch函数的用法

    http://blog.sina.com.cn/s/blog_707b64550100z1nz.html matlab中patch函数的用法——emily (2011-11-18 17:20:33) ...

  7. paper 121 :matlab中imresize函数

    转自:http://www.cnblogs.com/rong86/p/3558344.html matlab中函数imresize简介: 函数功能:该函数用于对图像做缩放处理. 调用格式: B = i ...

  8. MATLAB中FFT的使用方法

    MATLAB中FFT的使用方法 说明:以下资源来源于<数字信号处理的MATLAB实现>万永革主编 一.调用方法X=FFT(x):X=FFT(x,N):x=IFFT(X);x=IFFT(X, ...

  9. MATLAB中fft函数的正确使用方法

    问题来源:在阅读莱昂斯的<数字信号处理>第三章离散傅里叶变换时,试图验证实数偶对称信号的傅里叶变换实部为偶对称的且虚部为零.验证失败.验证信号为矩形信号,结果显示虚部是不为零且最大幅值等于 ...

随机推荐

  1. SEO人员应该突破的5大思想误区

    1.外链误区 很多人在做网站优化的时候容易陷入外链怪圈,认为外链就是网站优化的一切,只要做好外链排名就会上去,让他不做外链了他将不知道做什么.特别是外链专员和一些初级SEO人员,优化网站只知道到哪里发 ...

  2. 原生网络请求以及AFN网络请求/异步下载

    这里对网络请求方式做一个总结. 原生方式同步GET请求: NSString *urlStr = @"http://apis.juhe.cn/mobile/get?phone=13429667 ...

  3. mysql中使用正则表达式时的注意事项

    mysql不支持\d元字符匹配数字 mysql不支持向前.向后查找 regexp不能和not搭配使用

  4. 使用Transaction访问数据库(C#,TransactionScope,.NET 2.0)

    针对SQL2005和.NET 2.0的事物机制有了新的突破传统数据库事物访问机制,代码如下:                   或者这种,其实都差不多                         ...

  5. C# NameValueCollection集合 .

    案例: NameValueCollection nameValueCollection = Request.Params;//获得连接地址中的所有参数 //获取各个参数,eg:            ...

  6. o​r​a​l​c​e​ ​D​B​A​ ​培​训_lesson06

    控制文件 -小型二进制文件 -定义物理数据库的当前状态 -丢失控制文件须要修复 -维护数据库的完整性 -要求: 1.在启动数据库时处于mount状态 2.可以操作数据库 -仅仅链接至一个数据库 -最初 ...

  7. ASP.NET 验证码 不同浏览器 不刷新问题

    具体为什么不刷新是缓存机制不同,验证码图片的src或ImageUrl的获取是来自一个文件,由于连接地址没变所以不同内核浏览器有的会认为源没有变,解决办法就是在连接后面加上一个随机参数如可以用JS的Ma ...

  8. SVN 权限配置具体说明

    svnserve权限配置 分配权限时.文件夹应该应该遵从从大到小,权限应该从小到大的规则 即:文件夹从根文件夹開始,权限从没有权限(为空就可以)到可写再到可读写. 提示:文件夹的訪问权限既能够分配给组 ...

  9. SetEvent/ResetEvent

    在自己主动重置事件对象中,当WaitSingleObject/WaitForMultipleObjects接收到SetEvent发送过来的信号后则返回WAIT_OBJECT_0,此时操作系统(待定)自 ...

  10. Sass介绍及入门教程

    Sass是什么? Sass是"Syntactically Awesome StyleSheets"的简称.那么他是什么?其实没有必要太过于纠结,只要知道他是“CSS预处理器”中的一 ...