找回密码
 注册
关于网站域名变更的通知
查看: 528|回复: 1
打印 上一主题 下一主题

matlab中关于floor函数的作用

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2020-7-7 18:55 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

EDA365欢迎您登录!

您需要 登录 才可以下载或查看,没有帐号?注册

x
关于floor函数的作用:
( ~1 r2 ^& i4 Y- j" N, T7 J# L% y4 k' i  Q7 O5 Q
floor:朝负无穷方向舍入
6 m/ N, B- R6 t& B3 x4 h# k. \
: t8 h& H) ^+ z7 x, _! cB = floor(A) rounds the elements of A to the nearest integers less than or equal to A.5 [$ y' s$ m1 |! R
" C( K' d1 h% F- i; t
ceil:朝正无穷方向舍入$ _: d7 @% Q. Z7 r
! M$ [! q% _6 d  \  b
B = ceil(A) rounds the elements of A to the nearest integers greater than or equal to A.
4 `0 H) C* P6 V- \5 Y/ e1 V0 q/ `9 J& Q( b
fix:朝零方向舍入
5 p' H% P( X  ^
% }/ V, H! ^6 `6 cB = fix(A) rounds the elements of A toward zero, resulting in an array of integers.! n' r4 Y0 s9 Q8 [* b3 Z% _8 M
; M  Y/ c# Q4 a( h$ g
round:四舍五入$ w4 j# i1 l/ b" x- l: H3 u

* i* Z0 C! `. n( G$ D* r$ {B = round(A) rounds the elements of X to the nearest integers.  : s' V2 ?& W( Q7 w# R, q8 L
# i* g# Q3 |( ?$ m3 l
norm:求矩阵或向量的泛数  E7 v3 K0 U+ x0 D4 [$ {: |
* D, M/ E, G, Z) T/ {
             x = [1 2 3 4 5 6];
! d3 p' X5 ]( r: t% U* T' H8 f& O5 C2 v4 o1 A8 ~3 M
             norm(x) = 9.5394
& s% M- E7 Q! p7 ^/ E, p; q( s* S' k7 V
Example:* ~$ ^5 o" |9 F- {4 V# j
, O9 X0 M$ ]  ?4 B4 d6 A: h9 R# X
a=         [-0.9,    -2.1,    -0.4,    0.3,    0.8,    1.1,    2.7,    -1.2+2.9i];0 n, H; g$ t' x

& F/ k& O0 _6 W' n$ Y9 [! Qfloor(a)=[ -1,      -3,      -1,      0,      0,      1,      2,       -2+2i]9 Q* b2 ]0 R/ _9 d( l) X" B
1 P. y" U( V+ j* d
ceil(a)= [ 0,       -2,       0,      1,      1,      2,      3,       -1+3i]! R/ e3 K' K6 }: e' N5 d" _  r

" p- q/ F0 s+ d2 w/ w/ }fix(a)=    [ 0,       -2,       0,      0,      0,      1,      2,       -1+2i]1 e  B( p! i5 [* {3 v

' ?- g: h9 @" x! t7 lround(a)=[-1,       -2,       0,      0,      1,      1,      3,       -1+3i]& k5 o! O- t" z" r8 z9 L

& Q1 y6 j5 l4 E) }+ q' Y' l注:For complex X, for all the four fuctions the imaginary and real parts are rounded independently( @  N+ \# Y. I' `6 |, ~0 `2 r
& \1 w2 c( ~8 Q* o) w- a
, o1 H) z- t: W# ]

( g& t/ D% }& j' q

该用户从未签到

2#
发表于 2020-7-7 20:04 | 只看该作者
matlab中关于floor函数的作用
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

推荐内容上一条 /1 下一条

EDA365公众号

关于我们|手机版|EDA365电子论坛网 ( 粤ICP备18020198号-1 )

GMT+8, 2025-8-24 17:41 , Processed in 0.109375 second(s), 23 queries , Gzip On.

深圳市墨知创新科技有限公司

地址:深圳市南山区科技生态园2栋A座805 电话:19926409050

快速回复 返回顶部 返回列表