grouping binary digits from cell and convertion to a decimal value

2 ビュー (過去 30 日間)
Sharen H
Sharen H 2012 年 10 月 30 日
secret = [22 33
33 44]
after performing the following steps i was able to process every 2 binary
digits thanks for your help Andrei Bobrov
now i have to regrop the output into decimal value to retrieve the original secret back
bi = dec2bin(secret,8) - '0';
out = reshape(mat2cell(bi,ones(size(bi,1),1),2*ones(size(bi,2)/2,1))',1,[]);
How to regroup the answer to get back the original secret van u please help me

採用された回答

Andrei Bobrov
Andrei Bobrov 2012 年 10 月 30 日
a = reshape([out{:}],n,[])';
secret = reshape(a*pow2(size(a,2)-1:-1:0)',2,[])';

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMultirate Signal Processing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by