Quaternions with symbolic elements

9 views (last 30 days)
Bandar on 1 Feb 2022
Edited: James Tursa on 1 Feb 2022
I'm trying to create quaternion number that contains symbolic elements but Matlab throws an error.
syms a
This is the error I get
All inputs to the quaternion constructor must be the same class (double or
  1 Comment
James Tursa
James Tursa on 1 Feb 2022
Edited: James Tursa on 1 Feb 2022
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.

Sign in to comment.

Accepted Answer

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

More Answers (0)


Find more on Flight Parameters and Quaternion Math in Help Center and File Exchange




Community Treasure Hunt

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

Start Hunting!

Translated by