フィルターのクリア

Find the number of unmatched bits between two 128 bits

1 回表示 (過去 30 日間)
sohail hameed
sohail hameed 2017 年 10 月 30 日
回答済み: Walter Roberson 2017 年 10 月 30 日
Input: a=10011110010110101001111001111001100100101101111001101111111110110011110010001111000110000101010100111101011100000010000100000111; b=11000100010101000111001010010001110110001010011001100111011001010100110000011011111001101100101111111111010010100101000101011010;
Required answer : c=62

回答 (1 件)

Walter Roberson
Walter Roberson 2017 年 10 月 30 日
nnz( a ~= b )
This will work regardless of whether your a and b are vectors of doubles, or are vectors of char, or are vectors of logical values.

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by