help-octave
[Top][All Lists]
Advanced

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

Re: How to leave out selected elements from a vector?


From: Michael Goffioul
Subject: Re: How to leave out selected elements from a vector?
Date: Thu, 17 Jul 2008 12:01:21 +0200

On Thu, Jul 17, 2008 at 11:50 AM, Primoz PETERLIN
<address@hidden> wrote:
> Hello,
>
> Even after a couple of months of using Octave, I still consider myself
> a newbie. :)
>
> Here is my question. In Mathematica, there exists a function called
> Drop, which I often use to manipulate lists, e.g., Drop[ list, {m, n}
> ] returns the argument list with the elements m through n omitted from
> the list (the resultant list is shorter for (n - m + 1) elements).
>
> Does anything similar already exist in Octave? I know I can program it
> myself, but I wouldn't want to reinvent the wheel. :)

Use indexing. For instance [list(1:m-1), list(n+1:end)] could do what
you want.

Michael.


reply via email to

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