Array matching
7 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I have 2 arrays that i'd like to compare values and create a child that contains matching values (and I'd like to do this the fastest way possible).
Example:
A = [1;0;-1;0;0;0;1]
B = [0;1;-1;0;1;0;1]
child = [0;0;-1;0;0;0;1]
Your help is greatly appreciated! Thank you.
0 Kommentare
Antworten (1)
Geoff
am 26 Apr. 2012
child = A;
child(A ~= B) = 0;
Siehe auch
Kategorien
Mehr zu Data Type Identification finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!