power, .^
Syntax
Description
Examples
Raise a Quaternion to a Real Scalar Power
Create a quaternion and raise it to a real scalar power.
A = quaternion(1,2,3,4)
A = quaternion
1 + 2i + 3j + 4k
b = 3; C = A.^b
C = quaternion
-86 - 52i - 78j - 104k
Raise a Quaternion Array to Powers from a Multidimensional Array
Create a 2-by-1 quaternion array and raise it to powers from a 2-D array.
A = quaternion([1:4;5:8])
A = 2x1 quaternion array
1 + 2i + 3j + 4k
5 + 6i + 7j + 8k
b = [1 0 2; 3 2 1]
b = 2×3
1 0 2
3 2 1
C = A.^b
C = 2x3 quaternion array
1 + 2i + 3j + 4k 1 + 0i + 0j + 0k -28 + 4i + 6j + 8k
-2110 - 444i - 518j - 592k -124 + 60i + 70j + 80k 5 + 6i + 7j + 8k
Input Arguments
A
— Base
quaternion
object | array of quaternion
objects
Base, specified as a quaternion
object or an
array of quaternion
objects of any dimensionality.
A
and b
must have compatible sizes. In the
simplest cases, they can be the same size or one can be a scalar. Two inputs have
compatible sizes if, for every dimension, the dimension sizes of the inputs are the same
or one of the dimensions is 1.
b
— Exponent
real scalar | array of real numbers
Exponent, specified as a real scalar or an array of real numbers.
A
and b
must have compatible sizes. In the
simplest cases, they can be the same size or one can be a scalar. Two inputs have
compatible sizes if, for every dimension, the dimension sizes of the inputs are the same
or one of the dimensions is 1.
Data Types: single
| double
Output Arguments
Algorithms
The polar representation of a quaternion is given by
where θ is the angle of rotation, and û is the unit quaternion.
Quaternion A raised by a real exponent b is given by
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
Version History
Introduced in R2020b
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 (한국어)