QRMULT multiplies together two real quaternions matrices q=[q1,q2] Inputs: q1(4m,n) Two real quaternions arrays. Either array can q2(4n,r) also be a scalar quaternion. Outputs: q(4m,r) Matrix product of q1 and q2

- qrdotmult QRDOTMULT multiplies together two real quaternions arrays q=[q1,q2]
- rotqr2mr ROTQR2MR converts a matrix of real quaternion vectors to quaternion matrices

0001 function q=qrmult(q1,q2) 0002 %QRMULT multiplies together two real quaternions matrices q=[q1,q2] 0003 % 0004 % Inputs: q1(4m,n) Two real quaternions arrays. Either array can 0005 % q2(4n,r) also be a scalar quaternion. 0006 % 0007 % Outputs: q(4m,r) Matrix product of q1 and q2 0008 0009 % Copyright (C) Mike Brookes 2000-2012 0010 % Version: $Id: qrmult.m 1617 2012-03-15 09:14:01Z dmb $ 0011 % 0012 % VOICEBOX is a MATLAB toolbox for speech processing. 0013 % Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html 0014 % 0015 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0016 % This program is free software; you can redistribute it and/or modify 0017 % it under the terms of the GNU General Public License as published by 0018 % the Free Software Foundation; either version 2 of the License, or 0019 % (at your option) any later version. 0020 % 0021 % This program is distributed in the hope that it will be useful, 0022 % but WITHOUT ANY WARRANTY; without even the implied warranty of 0023 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0024 % GNU General Public License for more details. 0025 % 0026 % You can obtain a copy of the GNU General Public License from 0027 % http://www.gnu.org/copyleft/gpl.html or by writing to 0028 % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. 0029 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0030 s1=size(q1); 0031 s2=size(q2); 0032 if isequal(s1,[4 1]) 0033 q=qrdotmult(repmat(q1,s2(1)/4,s2(2)),q2); 0034 elseif isequal(s2,[4 1]) 0035 q=qrdotmult(q1,repmat(q2,s1(1)/4,s1(2))); 0036 else 0037 q=rotqr2mr(q1)*q2; 0038 end

Generated on Mon 06-Aug-2018 14:48:32 by