help-octave
[Top][All Lists]
Advanced

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

Re: uniq like function?


From: David Bateman
Subject: Re: uniq like function?
Date: Fri, 16 Apr 2010 09:14:30 +0200
User-agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090706)

Evan wrote:
I know there is a function of "unique" which returns unique elements.
I occasionally need a function like the "uniq" command under bash
which only omit adjacent repeated elements. For example, uniq ([1, 2,
2, 3, 2, 2]) returns [1, 2, 3, 2]. Is there already such a function in
octave? Thanks in advance.
_______________________________________________
Help-octave mailing list
address@hidden
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave

octave:7> x = [1,2,2,3,2,2]
x =

  1   2   2   3   2   2

octave:8> x(x(1:end-1)==x(2:end))=[]
x =

  1   2   3   2



reply via email to

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