nextpow2
Syntax
Description
Examples
Next Power of 2 of fi
Object
Define a fi
object and calculate the exponent for
the next higher power of 2.
N = fi(1000,1,18,2); P = nextpow2(N)
P = 10 DataTypeMode: Fixed-point: binary point scaling Signedness: Signed WordLength: 6 FractionLength: 0
Next Power of 2 of fi
Values
Define a vector of fi
values and calculate the
exponents for the next power of 2 higher than those values.
N = fi([1 -2 3 -4 5 9 519],1,16,3,2); P = nextpow2(N)
P = 1 0 1 2 3 3 10 DataTypeMode: Fixed-point: binary point scaling Signedness: Unsigned WordLength: 5 FractionLength: 0
Input Arguments
N
— Input values
scalar | vector | N-dimensional array
Input values, specified as a real-valued scalar, vector, or N-dimensional array.
Data Types: fi
Output Arguments
P
— Exponent of next higher power of 2
scalar | vector | N-dimensional array
Exponent of next higher power of 2, returned as a scalar, vector, or N-dimensional array.
The output is returned as an unsigned fi
object with binary-point
scaling, a fraction length of zero, and the smallest word length which can represent the
value of the largest returned exponent.
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
Slope-bias representation is not supported for code generation.
Fixed-Point Conversion
Design and simulate fixed-point systems using Fixed-Point Designer™.
Version History
Introduced in R2020a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)