Quaternions with symbolic elements
35 次查看(过去 30 天)
显示 更早的评论
I'm trying to create quaternion number that contains symbolic elements but Matlab throws an error.
syms a
d=quaternion(1,2,3,a)
This is the error I get
All inputs to the quaternion constructor must be the same class (double or
single).
1 个评论
James Tursa
2022-2-1
编辑:James Tursa
2022-2-1
What do you intend to do with these symbolic quaternions downstream in your code? It would be pretty easy to write your own basic functions such as add, subtract, multiply, conjugate, inverse, etc. But if you intend to convert them to other forms such as direction cosine matrix or Euler angles then you will run into major difficulties.
采纳的回答
Chris
2022-2-1
The error says it all. It looks like symbolic variables aren't supported for quaternions. You might try a third-party toolbox:
0 个评论
更多回答(1 个)
Bruno Luong
2024-11-5,12:19
Work around is use 2 x 2 (symboloc) complex matrix to do quaternion computation https://en.wikipedia.org/wiki/Quaternion#Matrix_representations
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Coordinate Transformations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!