[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: "end" for row vectors
From: |
Henry F. Mollet |
Subject: |
Re: "end" for row vectors |
Date: |
Thu, 18 Dec 2003 14:53:47 -0800 |
User-agent: |
Microsoft-Entourage/10.1.1.2418 |
I believe newer versions of Octave, allow the use of end (I'm using 2.1.46
on Ma). Otherwise, you can use length(x).
Henry
octave:10> x=[1 2 3]
x =
1 2 3
octave:11> x(end)
ans = 3
octave:12> x(length(x))
ans = 3
on 12/18/03 12:51 PM, Ricardo Cervera at address@hidden
wrote:
> Hello.
>
> I have some .m files I ran using matlab. The problem is that
> they use
>
>> v(end)
>
> in order to get the last element of a row-vector, and that doesn't
> seem to work on octave (version 2.1.35, debian package). Is there
> a similar syntax in octave to do so?
>
> Thanks.
>
>
>
>
> -------------------------------------------------------------
> Octave is freely available under the terms of the GNU GPL.
>
> Octave's home on the web: http://www.octave.org
> How to fund new projects: http://www.octave.org/funding.html
> Subscription information: http://www.octave.org/archive.html
> -------------------------------------------------------------
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------