Quaternions with symbolic elements

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
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
Chris 2022 年 2 月 1 日

0 投票

The error says it all. It looks like symbolic variables aren't supported for quaternions. You might try a third-party toolbox:

その他の回答 (1 件)

Bruno Luong
Bruno Luong 2024 年 11 月 5 日

0 投票

Work around is use 2 x 2 (symboloc) complex matrix to do quaternion computation https://en.wikipedia.org/wiki/Quaternion#Matrix_representations

カテゴリ

製品

リリース

R2021b

質問済み:

2022 年 2 月 1 日

回答済み:

2024 年 11 月 5 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by