parts
Syntax
Description
Examples
Convert Quaternion to Matrix of Quaternion Parts
Convert a quaternion representation to parts using the parts
function.
Create a two-element column vector of quaternions by specifying the parts.
quat = quaternion([1:4;5:8])
quat = 2x1 quaternion array
1 + 2i + 3j + 4k
5 + 6i + 7j + 8k
Recover the parts from the quaternion matrix using the parts
function. The parts are returned as separate output arguments, each the same size as the input 2-by-1 column vector of quaternions.
[qA,qB,qC,qD] = parts(quat)
qA = 2×1
1
5
qB = 2×1
2
6
qC = 2×1
3
7
qD = 2×1
4
8
Input Arguments
quat
— Quaternion
scalar | vector | matrix | multidimensional array
Quaternion, specified as a quaternion or array of quaternions.
Data Types: quaternion
Output Arguments
[a,b,c,d]
— Quaternion parts
scalar | vector | matrix | multidimensional array
Quaternion parts, returned as four arrays: a, b, c, and d. Each part is
the same size as quat
.
Data Types: single
| double
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
Version History
Introduced in R2021a
Abrir ejemplo
Tiene una versión modificada de este ejemplo. ¿Desea abrir este ejemplo con sus modificaciones?
Comando de MATLAB
Ha hecho clic en un enlace que corresponde a este comando de MATLAB:
Ejecute el comando introduciéndolo en la ventana de comandos de MATLAB. Los navegadores web no admiten comandos de MATLAB.
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)