Comparing two array of bit

13 ビュー (過去 30 日間)
zübeyir ddds
zübeyir ddds 2020 年 12 月 4 日
編集済み: zübeyir ddds 2020 年 12 月 12 日
I need to understand how much similar two arrays,
I have many '1×2048' array of bits and I need to how much similar these. Is there any criteria for this?
I don't know this but I tried overlatpink criteria but looks not working...
Here
find((and(rf4,f4))~=1 )
but I can't found numbers of bits 1.
K>> find((and(rf4,f4))~=1 )
ans =
Columns 1 through 14
1 2 3 4 6 7 9 12 13 16 17 18 20 21
Columns 15 through 28
22 23 24 26 27 30 31 34 35 36 37 38 39 40
Columns 29 through 42
42 43 44 45 46 47 48 49 50 51 54 55 56 58
Columns 43 through 56
60 62
...
How can I do difference measurement of two array?

採用された回答

zübeyir ddds
zübeyir ddds 2020 年 12 月 11 日
編集済み: zübeyir ddds 2020 年 12 月 12 日
Thanks to @Walter Roberson for correct answer
nnz command solved the problem
% I need to calculate which bits false and used and operator
a=[1 0 0 0 0 0]
a =
1 0 0 0 0 0
>> b=a
b =
1 0 0 0 0 0
>> nnz(and(a,b))
ans =
1

その他の回答 (1 件)

KALYAN ACHARJYA
KALYAN ACHARJYA 2020 年 12 月 4 日
編集済み: KALYAN ACHARJYA 2020 年 12 月 4 日
result=array1==array2
Considering, both are logical data type, as you mentioned '1×2048' array of bits'
Later you can use sum to see the total result, more sum value refelects more simmilar.
  3 件のコメント
Walter Roberson
Walter Roberson 2020 年 12 月 4 日
nnz(array1 == array2)
zübeyir ddds
zübeyir ddds 2020 年 12 月 4 日
thank you, thats works well

サインインしてコメントする。

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by