how can I FIND column of array part from another large array?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
areej abdulshaheed
am 21 Nov. 2019
Kommentiert: areej abdulshaheed
am 21 Nov. 2019
if I have two un equal matrix like A and B. How can I find the column of matrix A corrseponding to matrix B which have the same value?
for example if I have this array
B=[ 11 22 33 44 55 66 77 99 12 13 16 17 ]
A=[ 11 44 33 22 55 66 77 12]
0 Kommentare
Akzeptierte Antwort
Ruger28
am 21 Nov. 2019
Bearbeitet: Ruger28
am 21 Nov. 2019
MATLAB has a function for this : ismember
doc ismember
B=[11 22 33 44 55 66 77 99 12 13 16 17];
A=[11 44 33 22 55 66 77 12];
[TrueFalse,IndexValues] = ismember(A,B); % is A inside of B
% TrueFalse is a logical representation of the values of A in B
% IndexValues is the indices of those values in B
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Cell Arrays 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!