help-octave
[Top][All Lists]
Advanced

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

Re: index using end


From: Nicholas Jankowski
Subject: Re: index using end
Date: Wed, 15 Nov 2017 18:45:38 -0500



On Wed, Nov 15, 2017 at 5:22 PM, Doug Stewart <address@hidden> wrote:


On Wed, Nov 15, 2017 at 5:14 PM, asb <address@hidden> wrote:
octave doesn't recognize end as an index
Example:
>> foo=[1 2 3]
foo =

   1   2   3

>> foo(end)
error: 'a' undefined near line 9 column 12
error: called from
    end at line 9 column 5
error: evaluating argument list element number 1
error: called from
    end at line 9 column 5
error: evaluating argument list element number 1



works for me too:

>> foo = [1 2 3]
foo =

   1   2   3

>> foo(end)
ans =  3


have you tried clearing your workspace? since it's bringing up some error about a completely unrelated variable 'a', maybe you overwrote 'end' as a variable or function?


reply via email to

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