[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How can I tell if a function (rot2q.m) can be vectorized

From: RT
Subject: How can I tell if a function (rot2q.m) can be vectorized
Date: Fri, 15 Feb 2019 07:12:14 -0500

How can I tell if a function (rot2q.m) can be vectorized? 
This is my logic:
1) Convert multiple xyz points in array to quaternions using the function rot2q
2) Do calculations on multiple points from array in quaternions using the function quaternion
3) Convert quaternion array data back to xyz points using the function q2rot
4) Plot new xyz points using the function scatter3
The error I get is
"error: rot2q: first argument 'axis' must be a length three vector
error: called from
    rot2q at line 74 column 5
    test_quaternion_array_coversion at line 10 column 21"
Does the quaternion functions not allow vectorization?  And if not how can I change the functions to support this?
Some test code is below I've also attached the rot2q.m file :
I'm testing using Octave 5.0.91 on Ubuntu 18.04 64bit
clear all
pkg load quaternion
xyz_angle=[0  1  0  1.570796326794897;0.5  1  0  1.570796326794897]
pt_xyz_angle_to_quat=rot2q ([xyz_angle(:,1),xyz_angle(:,2),xyz_angle(:,3)], xyz_angle(:,4))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]