help-octave
[Top][All Lists]
Advanced

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

Re: end indexing


From: Laurent Jacques
Subject: Re: end indexing
Date: Wed, 31 Oct 2001 23:31:14 +0100

On Wednesday 31 October 2001 23:13, Brian Crounse wrote:
> Laurent,
>
> I would use either
>
>       a(2:length(a))
>
> or
>
>       a(2:size(a,2))

Of course, but this "end" term, present in matlab, is very handy in the case 
of multidmensional array. It simplifies notation.
For instance,

>> a = rand(5,5);
>> a(2:end-1,3:end)

is easier to write and to understand than

>> a(2:size(a,1)-1, 3:size(a,2))

Laurent.



-------------------------------------------------------------
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
-------------------------------------------------------------



reply via email to

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