octave-maintainers
[Top][All Lists]
Advanced

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

Re: error: end: no method for class double


From: fgnievinski
Subject: Re: error: end: no method for class double
Date: Mon, 16 Dec 2013 17:04:13 -0800 (PST)

I don't think you can call the builtin end explicitly, not even in MAtlab.

I'd do:

function ret = end (q, k, n)
    assert(ndims(q.w) < 3)
    switch n
    case 1
        ret = numel(q.w);
    case 2
        ret = size(q.w, k);
    otherwise
        ret = 1;
    end     
end

%!test
%! w = eye(3);
%! q = quaternion(w);
%! assert(q(end), w(end));
%! assert(q(end,1), w(end,1));
%! assert(q(1,end), w(end,1));





--
View this message in context: 
http://octave.1599824.n4.nabble.com/error-end-no-method-for-class-double-tp4660133p4660147.html
Sent from the Octave - Maintainers mailing list archive at Nabble.com.


reply via email to

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