1. 程式人生 > >MATLAB中floor的運用

MATLAB中floor的運用



floor

取不大於A且距離A最近的整數


Round toward negative infinity


Syntax




B = floor(A)








Description


B = floor(A) rounds theelements of A to the nearest integers less thanor equal to A. For complex A,the imaginary and real parts are rounded independently.




Examples
a = [-1.9  -0.2  3.4  5.6  7.0  2.4+3.6i];


floor(a)


ans =
  -2.0000     -1.0000     3.0000     5.0000     7.0000     2.0000 + 3.0000i