From: <par...@us...> - 2011-11-19 15:43:58
|
Revision: 9138 http://octave.svn.sourceforge.net/octave/?rev=9138&view=rev Author: paramaniac Date: 2011-11-19 15:43:51 +0000 (Sat, 19 Nov 2011) Log Message: ----------- quaternion_oo: add cat Modified Paths: -------------- trunk/octave-forge/extra/quaternion_oo/INDEX Added Paths: ----------- trunk/octave-forge/extra/quaternion_oo/inst/@quaternion/cat.m Modified: trunk/octave-forge/extra/quaternion_oo/INDEX =================================================================== --- trunk/octave-forge/extra/quaternion_oo/INDEX 2011-11-19 09:28:05 UTC (rev 9137) +++ trunk/octave-forge/extra/quaternion_oo/INDEX 2011-11-19 15:43:51 UTC (rev 9138) @@ -4,6 +4,7 @@ @quaternion/abs @quaternion/conj @quaternion/diag + @quaternion/inv @quaternion/ispure @quaternion/rows @quaternion/columns @@ -12,6 +13,7 @@ @quaternion/norm @quaternion/exp @quaternion/log + @quaternion/cat Overloaded and Arithmetic Operators @quaternion/plus @quaternion/minus @@ -19,7 +21,6 @@ @quaternion/uminus @quaternion/times @quaternion/mtimes - @quaternion/inv @quaternion/rdivide @quaternion/ldivide @quaternion/mrdivide Added: trunk/octave-forge/extra/quaternion_oo/inst/@quaternion/cat.m =================================================================== --- trunk/octave-forge/extra/quaternion_oo/inst/@quaternion/cat.m (rev 0) +++ trunk/octave-forge/extra/quaternion_oo/inst/@quaternion/cat.m 2011-11-19 15:43:51 UTC (rev 9138) @@ -0,0 +1,36 @@ +## Copyright (C) 2011 Lukas F. Reichlin +## +## This program is free software: you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation, either version 3 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this program. If not, see <http://www.gnu.org/licenses/>. + +## -*- texinfo -*- +## @deftypefn {Function File} {@var{q} =} cat (@var{dim}, @var{q1}, @var{q2}, @dots{}) +## Concatenation of quaternions along dimension @var{dim}. +## @end deftypefn + +## Author: Lukas Reichlin <luk...@gm...> +## Created: November 2011 +## Version: 0.1 + +function q = cat (dim, varargin) + + qstr = cellfun (@quaternion, varargin); # uniformoutput = true ! + + w = cat (dim, qstr.w); + x = cat (dim, qstr.x); + y = cat (dim, qstr.y); + z = cat (dim, qstr.z); + + q = quaternion (w, x, y, z); + +endfunction This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |