主要内容

exp

R2026b

Exponential for fixed-point data

Since R2026b

Description

Y = exp(X) returns the exponential eX for each element of the fixed-point input X.

Note

For the floating-point exponential, use the exp function.

example

Examples

collapse all

Create a signed fixed-point number with a 16-bit word length and 10-bit fraction length, and then evaluate the exponential.

x = fi(1.5,1,16,10);
y = exp(x)
y = 

4.481658935546875

      numerictype(1,67,18)

Create a fixed-point vector and evaluate the element-wise exponential.

x = fi([0 0.5 1 1.5 2],1,16,12)';
y = exp(x)
y = 

                         1
          1.64871597290039
          2.71826934814453
          4.48165893554688
          7.38897705078125
      numerictype(1,31,18)

Input Arguments

collapse all

Fixed-point input, specified as a scalar, vector, matrix, or multidimensional fi object. X must be real-valued and use binary-point scaling.

Data Types: fi

Output Arguments

collapse all

Exponential values, returned as a scalar, vector, matrix, or multidimensional array. The output Y is a signed fi object with the same dimensions as X. The output word length and fraction length are determined automatically based on the input type to preserve the precision and range of the result.

Data Types: fi

Extended Capabilities

expand all

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

Version History

Introduced in R2026b

See Also

| | | |