Main Content

int16

Convert fi object to signed 16-bit integer

Syntax

c = int16(a)

Description

c = int16(a) returns the built-in int16 value of fi object a, based on its real world value. If necessary, the data is rounded-to-nearest and saturated to fit into an int16.

Examples

This example shows the int16 values of a fi object.

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

c =

   -3    0    3

Extended Capabilities

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