Get the column number of the false values in a logical output
9 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Vance Blake
am 9 Dez. 2020
Kommentiert: Vance Blake
am 9 Dez. 2020
I am trying to get the column numebr of the false values in a logical output called 'index'. My code is below
N = 50;
A = 1:N;
B = 1:41;
index = ismember(A,B);
C = index(index == 0);
0 Kommentare
Akzeptierte Antwort
Rik
am 9 Dez. 2020
You can use the find function:
N = 50;
A = 1:N;
B = 1:41;
index = ismember(A,B);
[row,col] = find(~index);
disp(col)
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Matrix Indexing 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!