フィルターのクリア

Get the column number of the false values in a logical output

9 ビュー (過去 30 日間)
Vance Blake
Vance Blake 2020 年 12 月 9 日
コメント済み: Vance Blake 2020 年 12 月 9 日
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);

採用された回答

Rik
Rik 2020 年 12 月 9 日
You can use the find function:
N = 50;
A = 1:N;
B = 1:41;
index = ismember(A,B);
[row,col] = find(~index);
disp(col)
42 43 44 45 46 47 48 49 50

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

製品


リリース

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by