floor:朝负无穷方向舍入
B = floor(A) rounds the elements of A to the nearest integers less than or equal to A.
 
ceil:朝正无穷方向舍入 
B = ceil(A) rounds the elements of A to the nearest integers greater than or equal to A.
 
fix:朝零方向舍入 
B = fix(A) rounds the elements of A toward zero, resulting in an array of integers.
 
round:四舍五入 
B = round(A) rounds the elements of X to the nearest integers.  
 
Example:

a=       [-0.9,  -2.1,  -0.4,  0.3,  0.8,  1.1,  2.7,  -1.2+2.9i];

floor(a)=[ -1,    -3,    -1,    0,    0,    1,    2,     -2+2i]

ceil(a)= [ 0,     -2,     0,    1,    1,    2,    3,     -1+3i]

fix(a)=  [ 0,     -2,     0,    0,    0,    1,    2,     -1+2i]

round(a)=[-1,     -2,     0,    0,    1,    1,    3,     -1+3i]

注:For complex X, for all the four fuctions the imaginary and real parts are rounded independently.
 

关于Matlab里面的四个取整(舍入)函数:Floor, Ceil, Fix, Round的解释(转)的更多相关文章

  1. Matlab中的取整-floor,ceil,fix,round

    FLOOR Round towards minus infinity. FLOOR(X) rounds the elements of X to the nearest integers toward ...

  2. java的四种取整方法

    java 中取整操作提供了四种方法:分别是: public static double ceil(double a)//向上取整  public static double floor(double ...

  3. js 小数取整的函数

    1.丢弃小数部分,保留整数部分 js:parseInt(7/2) 2.向上取整,有小数就整数部分加1 js: Math.ceil(7/2) 3,四舍五入. js: Math.round(7/2) 4, ...

  4. js 中小数取整的函数

    1.丢弃小数部分,保留整数部分 js:parseInt(7/2) 2.向上取整,有小数就整数部分加1 js: Math.ceil(7/2) 3,四舍五入. js: Math.round(7/2) 4, ...

  5. JS中对小数取整的函数,向上(下),四舍五入取整

    1.丢弃小数部分,保留整数部分 js:parseInt(7/2) 2.向上取整,有小数就整数部分加1 js: Math.ceil(7/2) 3,四舍五入. js: Math.round(7/2) 4, ...

  6. JS对象 向上取整ceil() ceil() 方法可对一个数进行向上取整。 语法: Math.ceil(x) 注意:它返回的是大于或等于x,并且与x最接近的整数。

    向上取整ceil() ceil() 方法可对一个数进行向上取整. 语法: Math.ceil(x) 参数说明: 注意:它返回的是大于或等于x,并且与x最接近的整数. 我们将把 ceil() 方法运用到 ...

  7. C/C++四种取整函数floor,ceil,trunc,round

    处理浮点数操作常用到取整函数,C/C++提供了四种取整函数 floor函数 floor函数:向下取整函数,或称为向负无穷取整 double floor(double x); floor(-5.5) = ...

  8. iOS 常用的向上,向下取整, 四舍五入函数

    向上取整:ceil(x),返回不小于x的最小整数; 向下取整:floor(x),返回不大于x的最大整数; 四舍五入:round(x) 截尾取整函数:trunc(x)  

  9. js只保留整数,向上取整,四舍五入,向下取整等函数

    1.丢弃小数部分,保留整数部分 parseInt(5/2) 2.向上取整,有小数就整数部分加1 Math.ceil(5/2) 3.四舍五入. Math.round(5/2) 4.向下取整 Math.f ...

随机推荐

  1. rvm is not a function的解决方法

    今天在使用rvm 1.9.3 --default设置默认的ruby的命令时出现 RVM is not a function, selecting rubies with 'rvm use ...' w ...

  2. DelegatingFilterProxy类的作用

    使用过springSecurity的朋友都知道,首先需要在web.xml进行以下配置 <filter> <filter-name>springSecurityFilterCha ...

  3. .net mvc Razor 三元运算判断赋值 ?:

    预期效果: 当Model中的Age数字列值为0时,不显示该值. <input type="text" class="form-control onlyPositiv ...

  4. Echart 改变X轴、Y轴、折线的颜色和数值

    在操作E-chart时需要根据需求改变颜色和属性 图1: option = { xAxis: { type: 'category', data: ['Mon', 'Tue', 'Wed', 'Thu' ...

  5. Java并发常见问题

    ConcurrentHashMap源码分析,参考:http://blog.csdn.net/do_smile/article/details/46911727 HashMap源码分析,参考:http: ...

  6. 3 springboot配置文件

    springboot 是习惯优于配置,抛弃SSM中繁琐的配置内容,大量的基础配置由框架的完成.所以我们现在没有用任何的配置文件,可以快速的将项目运行起来. 我们找到web模块中的application ...

  7. Java Swing实战(五)表格组件JTable(1)

    dbPanel面板的配置告一段落. 接下来配置taskPanel 面板. /** * @author: lishuai * @date: 2018/11/26 13:51 */ public clas ...

  8. item2 快捷键

    快捷键 ⌘ + Click:可以打开文件,文件夹和链接 ⌘ + n:新建窗口 ⌘ + t:新建标签页 ⌘ + w:关闭当前页 ⌘ + 数字 & ⌘ + 方向键:切换标签页 ⌥⌘ + 数字:切换 ...

  9. element ui 时间控件 多个日期

    前言:工作中用到 vue+element ui 的前端框架,需要使用时间控件来选择多个日期,已月日的形式,且有默认值,所以记录一下.转载请注明出处:https://www.cnblogs.com/yu ...

  10. LOJ#6463 AK YOI 树分治+线段树合并

    传送门 既然是树上路径统计问题,不难想到要使用树分治,这里以点分治为例 由点分治的性质,每层只需要考虑经过重心的路径 因为需要维护路径长度在一定范围内的最大权值和,所以要用一个数据结构维护一下到根节点 ...