Spyros
Spyros

Reputation: 289

Array of quaternions in MATLAB

I want to create an array (or a vector) of Quaternions in MATLAB.

I am doing an interpolation and I want to store the values of the interpolated quaternions in an array.

The problem is how can I define this array so that every result of my for loop will be stored in an data structure of quaternion?

I use the robotics toolbox for the Quaternions.

Upvotes: 0

Views: 458

Answers (1)

Daniel
Daniel

Reputation: 36720

In Matlab a quaternion is a 1x4 vector, thus an array of quaternions is a nx4 matrix.

%create:
x=zeros(n,4);
%access:
x(2,:)

Upvotes: 1

Related Questions