https://github.com/kostaspap88/scatter
Raw File
Tip revision: 6820d351fbd6de370256128c3e60a83cca95eb66 authored by Kostas Papagiannopoulos on 10 October 2019, 12:29:27 UTC
Update README.md
Tip revision: 6820d35
hw.m
% compute the hamming weight for every matrix element

function result = hw(input)

    result = arrayfun(@(el) sum(dec2bin(el)=='1'), input);

end
back to top