help-octave
[Top][All Lists]
Advanced

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

arrayfun on quaternion arrays


From: octavecontrib
Subject: arrayfun on quaternion arrays
Date: Sat, 6 Jun 2020 12:21:34 +0530

Since 'quat_____' functions were not available in Octave, I have used the Octave quaternion package.
The arrayfun and cellfun functions do not work on quaternion arrays.

System details

GNU Octave, version 4.2.2, Octave was configured for "x86_64-pc-linux-gn. Ubuntu 18.04.

Minimum working example with output i received in comments

pkg load quaternion

qqq = [quaternion(1,0,0,0);
       quaternion(1,0,0,0)];

whos
% Attr Name        Size                     Bytes  Class
% ==== ====        ====                     =====  =====
%    qqq         2x1                         64  quaternion

arrayfun(@(x)1, qqq)
% ans =  1

arrayfun(@(x)abs(x), qqq)
% error: arrayfun: all values must be scalars when UniformOutput = true


Is there a way to avoid writing loops ?


reply via email to

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