Main Content

int16

Convert fi object to signed 16-bit integer

Description

b = int16(a) converts the fi object a to a signed 16-bit integer based on its real-world value. If necessary, the data is rounded-to-nearest and saturated to fit in an int16 type with no warning.

example

Examples

collapse all

a = fi([-pi 0.1 pi],1,16);
b = int16(a)
b =

  1×3 int16 row vector

   -3    0    3

Input Arguments

collapse all

Input fi array, specified as a scalar, vector, matrix, or multidimensional array.

Data Types: fi
Complex Number Support: Yes

Extended Capabilities

expand all

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

HDL Code Generation
Generate VHDL, Verilog and SystemVerilog code for FPGA and ASIC designs using HDL Coder™.

Version History

Introduced before R2006a