power, .^
Fixed-point element-wise power
Syntax
Description
Examples
Raise Each Element of a Matrix to a Scalar Power
Create a fixed-point matrix and raise it to a scalar power.
A = fi([1, 3; 4, 2])
A = 1 3 4 2 DataTypeMode: Fixed-point: binary point scaling Signedness: Signed WordLength: 16 FractionLength: 12
C = A.^3
C = 1 27 64 8 DataTypeMode: Fixed-point: binary point scaling Signedness: Signed WordLength: 48 FractionLength: 36
Input Arguments
A
— Base
scalar | vector | matrix | multidimensional array
Base, specified as a scalar, vector, matrix, or multidimensional array. Inputs
A
and B
must either be the same size or have
sizes that are compatible (for example, A
is an
M-by-N matrix and B
is a
scalar or 1-by-N row vector).
Data Types: single
| double
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
| logical
| fi
Complex Number Support: Yes
B
— Exponent
scalar
Exponent, specified as a non-negative, real, integer-valued scalar.
Data Types: single
| double
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
| logical
| fi
Output Arguments
C
— Power
scalar | vector | matrix | multidimensional array
Power, returned as an array with the same dimensions as the input
A
. When A
has a local fimath
object, the output C
also has the same local
fimath
object. The array power operation is always performed using
the default fimath
settings.
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
Usage notes and limitations:
When the exponent
B
is a variable, theProductMode
property of the governingfimath
must beSpecifyPrecision
.
HDL Code Generation
Generate VHDL, Verilog and SystemVerilog code for FPGA and ASIC designs using HDL Coder™.
Both inputs must be scalar, and the exponent input, B
, must be a
constant integer.
Version History
Introduced in R2010aR2021a: Improved numerical accuracy and generated code efficiency for fi
inputs to power, .^
Fixed-Point Designer™ now has improved numerical accuracy for fixed-point inputs to the
power
function in simulation and generated code. Additionally,
generated code is more efficient.
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 (한국어)