help-octave
[Top][All Lists]
Advanced

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

select equal element between matrices


From: gigiolone123
Subject: select equal element between matrices
Date: Fri, 8 Feb 2019 17:26:33 -0600 (CST)

hi guys, a give you a difficult question

a=[3 2 5 5 6 6 2 3]
b=[0 1 0 0 1 1 0 0]
c=["a","b","a","a","b","c","a","a"]


I want combine each index with the others

ans:
3 0 a
2 1 b
5 0 a
5 0 a
6 1 b
6 1 c
2 0 a
3 0 b


I consider only the same pairs (3 0 a   and 5 0 a)


returns the number index of equal pairs
ans:[1 4]

it's possibile to do this avoit loop? thank






--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html



reply via email to

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