文章出处:

http://evaevazhuxun.blog.sohu.com/154543859.html

http://blog.sina.com.cn/s/blog_a4034b2801012o1n.html

1.roundn

a=123.4567890;
a=roundn(a,-4)

% 返回 123.4568

Round numbers to specified power of 10

2.round

函数简介

  调用格式:Y = round(X)

  在matlab中round也是一个四舍五入函数。在matlab的命令窗口中输入doc round或者help round即可获得该函数的相关帮助信息。

  相关函数:ceil、floor、fix

程序示例

  >>a = [-1.9, -0.2, 3.4, 5.6, 7.0, 2.4+3.6i]

  a =

  Columns 1 through 4

  -1.9000 -0.2000 3.4000 5.6000

  Columns 5 through 6

  7.0000 2.4000 + 3.6000i

  >>round(a)

  ans =

  Columns 1 through 4

  -2.0000 0 3.0000 6.0000

  Columns 5 through 6

  7.0000 2.0000 + 4.0000i

  a =

  Columns 1 through 4

  -1.9000 -0.2000 3.4000 5.6000

  Columns 5 through 6

  7.0000 2.4000 + 3.6000i

matlab初学之roundn和round的更多相关文章

  1. matlab初学之句柄

    文章出处:http://www.cnblogs.com/CBDoctor/archive/2012/04/06/2434072.html 在matlab中,每一个对象都有一个数字来标识,叫做句柄.当每 ...

  2. matlab中fix, floor, ceil, round 函数的使用方法

    转载: https://www.ilovematlab.cn/thread-91895-1-1.html Matlab取整函数有: fix, floor, ceil, round.具体应用方法如下: ...

  3. matlab初学之strcat、num2str

    文章出处: http://blog.sina.com.cn/s/blog_6fb8aa0d01019id5.html http://wenda.so.com/q/1439143662729624 ht ...

  4. matlab初学之textread

    文章出处:http://blog.sina.com.cn/s/blog_9e67285801010bju.html 基本语法是: [A,B,C,-] = textread(filename,forma ...

  5. matlab初学之plot颜色和线型

    文章出处: http://jiangshuxia.9.blog.163.com/blog/static/3487586020116711375339/ 字母        颜色          标点 ...

  6. MATLAB中取整函数(fix, floor, ceil, round)的使用

    MATLAB取整函数 1)fix(x) : 截尾取整. >> fix( [3.12 -3.12]) ans = 3    -3(2)floor(x):不超过x 的最大整数.(高斯取整) & ...

  7. paper 68 :MATLAB中取整函数(fix, floor, ceil, round)的使用

    MATLAB取整函数 1)fix(x) : 截尾取整. >> fix( [3.12 -3.12]) ans =      3    -3 (2)floor(x):不超过x 的最大整数.(高 ...

  8. MATLAB中floor、round、ceil、fix区别

    Matlab取整函数有: fix, floor, ceil, round.具体应用方法如下:fix朝零方向取整,如fix(-1.3)=-1; fix(1.3)=1;floor,顾名思义,就是地板,所以 ...

  9. matlab基本函数inf, isempty, round, floor, fix

    一起来学演化计算-matlab基本函数inf, isempty, round, floor ,fix 觉得有用的话,欢迎一起讨论相互学习~Follow Me inf matlab中 inf无穷大量+∞ ...

随机推荐

  1. web 打开子窗口提交数据或其他操作后 关闭子窗口且刷新父窗口实现

    父页面 : html连接:<a href="javascript:void(0)" onclick="window.open(子页面URL)">js ...

  2. js数据类型

    JavaScript数据类型是非常简洁的,它只定义了6中基本数据类型 null:空.无.表示不存在,当为对象的属性赋值为null,表示删除该属性 undefined:未定义.当声明变量却没有赋值时会显 ...

  3. wordpress目录文件结构说明

    wordpress目录文件结构说明   wordpress目录文件结构说明. WordPress文件夹内,你会发现大量的代码文件和3个文件夹wp-admin wp-content wp-include ...

  4. ajax向后台传递数组

    $.ajax({ traditional: true//这个设置为true,data:{"steps":["qwe","asd"," ...

  5. HTTP历程

    原文http://www.ruanyifeng.com/blog/2016/08/http.html 1.HTTP/0.9 HTTP是基于TCP/IP协议的应用层协议.它不涉及数据包传输,主要规定了客 ...

  6. JAVA类与对象

    Employee类: public class EmployeeTest { public static void main(String[] args) { // fill the staff ar ...

  7. Windows Store App JavaScript 开发:小球运动示例

    通过前面内容的学习,相信读者已经对开发基于JavaScript的Windows应用商店应用有了一定的了解,本小节通过一个小球运动的示例来介绍如何新建一个JavaScript的Windows应用商店项目 ...

  8. uploadify参数

    $(document).ready(function() { $("#file_upload").uploadify({ //开启调试 'debug' : false, //是否自 ...

  9. silk mpu

    #include "mpu.h" #include "mbuf.h" #include "media_buffer.h" #include ...

  10. MongoDB aggregate 运用篇 个人总结

    最近一直在用mongodb,有时候会需要用到统计,在网上查了一些资料,最适合用的就是用aggregate,以下介绍一下自己运用的心得.. 别人写过的我就不过多描述了,大家一搜能搜索到N多一样的,我写一 ...