[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: a=0; a([1,1])++ -> a == 2
From: |
Etienne Grossmann |
Subject: |
Re: a=0; a([1,1])++ -> a == 2 |
Date: |
Thu, 3 Aug 2000 08:18:03 GMT |
Hello again,
===================================================
J=sort(I);
k=find([1,diff(J)]);
a(J(k))=diff([k,length(J)+1]);
===================================================
Looks quite good. Probably can be adapted to += anything too.
Thanks.
Etienne
-----------------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.che.wisc.edu/octave/octave.html
How to fund new projects: http://www.che.wisc.edu/octave/funding.html
Subscription information: http://www.che.wisc.edu/octave/archive.html
-----------------------------------------------------------------------