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

카테고리

도움말 센터File Exchange에서 Coordinate Transformations에 대해 자세히 알아보기

제품

릴리스

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