EDA365电子论坛网

标题: matlab中关于floor函数的作用 [打印本页]

作者: uqHZau    时间: 2020-7-7 18:55
标题: matlab中关于floor函数的作用
关于floor函数的作用:
! ~( }& Y8 s( L5 f3 r# n0 H0 P4 W" @- ^9 x( D# }
floor:朝负无穷方向舍入
9 Q: O# U; l( Z$ U* l0 p: ^5 F. Z" N$ u$ Y' h
B = floor(A) rounds the elements of A to the nearest integers less than or equal to A.
1 @; t- J; s' z4 s1 p& ~* T7 y  T: w- I! |: r8 m
ceil:朝正无穷方向舍入! p! c" q$ H( H, C. B  I" U
& c. r4 x( R& @+ g" a' o/ q% E
B = ceil(A) rounds the elements of A to the nearest integers greater than or equal to A.
' {1 _5 D+ L7 Q$ |. r7 e, e
0 _$ ?9 [. V3 a3 o$ h; t0 t3 Qfix:朝零方向舍入
1 {! P: |; c6 r9 v! C, n6 S  j
& C- X1 c# _* k2 \3 s+ {" M6 T5 PB = fix(A) rounds the elements of A toward zero, resulting in an array of integers.( S: f, T* j3 e7 m) M& B+ K+ S

0 ~  l$ W, z' ?) U5 M# q$ vround:四舍五入2 T8 `' F; w' |$ f6 u

* N5 y7 f( O7 Z7 E! t3 mB = round(A) rounds the elements of X to the nearest integers.  9 P5 C& v% F( E$ v. M; {

" H9 G& s' L0 y& s' M0 k& ~- pnorm:求矩阵或向量的泛数
" g- V: {6 E' x
0 _# j' Z* C; g' N+ A$ l- U             x = [1 2 3 4 5 6];: F- b7 ?" F( j8 M2 w# B8 |% M
* _+ L+ R5 b) G7 `/ O
             norm(x) = 9.5394
2 V5 |: G  _* v6 b. B9 `' ~1 }
+ G- a) U) @8 z! V5 M& s' cExample:; q2 Q  a2 }+ s6 N' D
& {  |  O1 y& `2 Y4 m
a=         [-0.9,    -2.1,    -0.4,    0.3,    0.8,    1.1,    2.7,    -1.2+2.9i];
# Y7 L/ e8 N+ i- R# t- G9 J+ J2 m* f" H6 N+ j
floor(a)=[ -1,      -3,      -1,      0,      0,      1,      2,       -2+2i]5 ?+ ]* T8 ~/ E. M% I# C
  a* h. W! Y9 i& x* f
ceil(a)= [ 0,       -2,       0,      1,      1,      2,      3,       -1+3i]9 a9 u0 e9 C8 {" A9 a

( I0 r* Y# }# C* ^" Q; rfix(a)=    [ 0,       -2,       0,      0,      0,      1,      2,       -1+2i]
& G& I6 b& z# j2 e2 b
, L+ x6 P' h7 d" o: ?$ J4 bround(a)=[-1,       -2,       0,      0,      1,      1,      3,       -1+3i]% x0 z, _2 m1 n( w* j4 Z, L0 j- U

' B. @" Y* c5 j) k2 \注:For complex X, for all the four fuctions the imaginary and real parts are rounded independently( \7 `0 {# f2 K

3 ?& W4 y1 @( l' n) z7 M* M
9 T5 {, X! U# P, V9 m3 n. r- Y$ z
3 X  u) V% i/ ^; {; L$ k3 R
作者: NNNei256    时间: 2020-7-7 20:04
matlab中关于floor函数的作用




欢迎光临 EDA365电子论坛网 (https://bbs.eda365.com/) Powered by Discuz! X3.2