help-octave
[Top][All Lists]
Advanced

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

Re: removing replicated rows from a (large) matrix


From: Joao Cardoso
Subject: Re: removing replicated rows from a (large) matrix
Date: Sat, 05 Aug 2000 18:38:38 +0100

Etienne Grossmann wrote:
> 
>   Hello,
> 
>   are you sure it works? I renamed it joao_uniq, and it gives :
> 
> octave:144> x(1:15,:)' , x(joao_uniq (x(1:15,:)),:)'
> ans =
> 
>   0  0  0  0  0  0  0  0  0  0  1  1  1  1  1
>   1  1  1  2  3  4  5  6  9  9  0  0  4  5  5
> 
> ans =
> 
>   0  0  0  1  1
>   1  1  9  0  5
> 
>   isn't there a problem?

no, those are the elements to remove. As the help says,

   Executing `data(unique(data),:) = []', will leave `data' with unique
rows,
                                   ^^^^

I agree, it should not be called 'unique' but 'repeated indexes'.

But your uniq(lexicosort(A)) is faster, and give the same results.
Thanks

Joao


> 
>   For the same effect, you can use uniq(), from my "misc" toolbox, after 
> passing
> the data to sortrows (Paul Kienzle's) or lexicosort() ("misc" toolbox).
> 
>   Etienne
> 
> ps : I think unique() is used as a synonym to create_set() (or almost)



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



reply via email to

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