[Scilab-users] Remove duplicate rows and sustain original order of rows

Stéphane Mottelet stephane.mottelet at utc.fr
Wed Jun 13 14:41:54 CEST 2018


Le 13/06/2018 à 14:00, CHEZE David 227480 a écrit :
> Hi Iza,
>
> Just consider this tip from the unique help page:
>
> Extracted components, rows or columns can be resorted in their initial order by sorting k:
> [N, k] = unique(M);      k = gsort(k,"g",i); N = N(k)
> [N, k] = unique(M, "c"); k = gsort(k,"g",i); N = N(:, k)
> [N, k] = unique(M, "r"); k = gsort(k,"g",i); N = N(k, :)
>
> Hope it helps,
No, it does not help, since unique seems to be broken again:

http://bugzilla.scilab.org/show_bug.cgi?id=15610

S.

> David
>
>
> -----Message d'origine-----
> De : users <users-bounces at lists.scilab.org> De la part de Izabela Wójcik-Grzaba
> Envoyé : mercredi 13 juin 2018 13:44
> À : users at lists.scilab.org
> Objet : [Scilab-users] Remove duplicate rows and sustain original order of rows
>
> Hi all,
>
> I can't figure out how to remove duplicate rows from the matrix and go back to the original order of rows. Function "unique" with an option "r"
> sorts rows in lexicographic ascending order.
>
> Thanks in advance for any help,
> Iza
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users


-- 
Stéphane Mottelet
Ingénieur de recherche
EA 4297 Transformations Intégrées de la Matière Renouvelable
Département Génie des Procédés Industriels
Sorbonne Universités - Université de Technologie de Compiègne
CS 60319, 60203 Compiègne cedex
Tel : +33(0)344234688
http://www.utc.fr/~mottelet




More information about the users mailing list