[Scilab-users] Advice from Scilab community

CHEZE David 227480 david.cheze at cea.fr
Tue Oct 22 14:14:58 CEST 2013


Hi Paul,

You may have a look at the function find() which is a serialized function and then you may test the size of the result which will tell you if there's a match and where.
At first sight you'll have to test sequentially with the 4 different permutations (only 4 iterations).

David

De : users [mailto:users-bounces at lists.scilab.org] De la part de Carrico, Paul
Envoyé : mardi 22 octobre 2013 13:58
À : users at lists.scilab.org
Objet : [Scilab-users] Advice from Scilab community

Dear All

I'm asking here an advice from the community in order to find a (fast and clean) solution ; I've the following issue :

-          I've a (n x 4) matrix where n may be huge (several hundred thousand of lines is common )

-          I need to find and to remove the line wich has the same numbers (but different in order)

-          I know that there's only one occurrence ... thus when it has been found, not necessary to continue

Example :

A = [
X  X  X      X
X  X  X      X
1 9 1000 994423
X  X  X      X
X  X  X      X
X  X  X      X
1000 994423 1 9  ... or 994423 1 9 1000 ... or 9 1000 994423 ... only 3 possible permutations
X  X  X      X
X  X  X      X
X  X  X      X
]

Any suggestion that avoids the use of (intensive ugly) loops ?


NB:
additional question :

-          If t = [1 2 3 4]

-          If v = [1 2 3 4]

-          If z = [0 2 3 9]

-          Then (t == v) provides [T T T T]

-          Then (z == v) provides [F T T F]

-           .... Is it possible to have a single Boolean with all the cells met the requirement (T) and when it's not the case (F) ?

Thanks in advance

Paul



--------------------------------------------------------------------------------





Le pr?sent mail et ses pi?ces jointes sont confidentiels et destin?s ? la personne ou aux personnes vis?e(s) ci-dessus. Si vous avez re?u cet e-mail par erreur, veuillez contacter imm?diatement l'exp?diteur et effacer le message de votre syst?me. Toute divulgation, copie ou distribution de cet e-mail est strictement interdite.



This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error, please contact the sender and delete the email from your system. If you are not the named addressee you should not disseminate, distribute or copy this email.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20131022/82d6fee7/attachment.htm>


More information about the users mailing list