|
|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
关于floor函数的作用:
, J4 s- y/ w" T! U! Q
0 j M; q4 u/ s* jfloor:朝负无穷方向舍入 {' U/ |1 q8 @3 c" B( {, i
5 j" r3 s/ G+ l6 w
B = floor(A) rounds the elements of A to the nearest integers less than or equal to A.
7 k* X0 u; G) f! h. p$ d
. i4 }7 i8 o. s2 x# pceil:朝正无穷方向舍入4 M2 @4 P& O" b$ L
0 V) C& E! s# z0 p
B = ceil(A) rounds the elements of A to the nearest integers greater than or equal to A.
% Q' y& n4 X; M3 s* w3 i5 j5 I) E* c
fix:朝零方向舍入9 w- B- r% A: h. A C
/ a+ Z; o1 l4 e# b4 K) P
B = fix(A) rounds the elements of A toward zero, resulting in an array of integers.
/ o' Q2 e. V6 A% w
" S5 K8 B/ b9 E+ c, M) X- s) K5 N5 b9 J8 iround:四舍五入
, d1 Z. _! u. N' o) l
9 q7 F9 y( f$ L0 f2 DB = round(A) rounds the elements of X to the nearest integers. 1 \- D/ v) O# B. i, d1 M
: K3 n- [$ R# q2 V' u/ s$ [" ~7 U
norm:求矩阵或向量的泛数
3 e2 U4 Z! ? ^* n3 o* `& l7 Z8 p/ @; _! I5 F% E
x = [1 2 3 4 5 6];! M1 y/ G! l; |* y7 f( H* t: ~: f: H
+ y: S* h. D: A/ \ norm(x) = 9.5394$ d' w1 R w8 C3 ?% b" O
7 ]' v: V3 Z% B
Example:) [; T' K+ ]3 m; M4 C+ x
. J- K* o, A! |4 Qa= [-0.9, -2.1, -0.4, 0.3, 0.8, 1.1, 2.7, -1.2+2.9i];* R3 F+ A- J$ H: m: ?4 x
/ I0 K* T5 o# S! q8 Efloor(a)=[ -1, -3, -1, 0, 0, 1, 2, -2+2i]
9 y1 [" N9 v5 s& W
- m. |& I! P9 _ceil(a)= [ 0, -2, 0, 1, 1, 2, 3, -1+3i]
! E8 \( r! [& n' z0 r& u; a
& h2 @+ f; K+ ofix(a)= [ 0, -2, 0, 0, 0, 1, 2, -1+2i]
+ U7 n6 h( h" y& b8 b; R7 G! C. f( U. ?" M
round(a)=[-1, -2, 0, 0, 1, 1, 3, -1+3i]
/ W! a7 p q, E4 K, q" G! _4 H
& Q6 ]( i; r0 s; w注:For complex X, for all the four fuctions the imaginary and real parts are rounded independently
3 ^, H6 D1 Z/ K* l" p4 t; {; p8 `- c/ v7 |% B; t
( X: x n" Z/ m9 z4 u7 |" Q7 u
J3 y( D. ^2 ]% o$ v |
|