MATLAB: How can I convert a decimal to an integer

convert decimal integer

how can I convert a decimal to an integer?
example
1.232422->1
2123.43242322->2123

Best Answer

  • fix to strip all the decimals
  • round can change the integer part
fix (1.9) % 1
round(1.9) % 2