Stream of binary to decimal value

1 回表示 (過去 30 日間)
Kaung
Kaung 2012 年 3 月 7 日
Hi I am trying to convert every 8 bit of binary values from binary string such as A=[011101010..] to the decimal values and store it back into original matrix dimension. Unfortunately there is no such thing like str=bin2dec(A,8). This is my work for trasmitter part: K= [251 252 0 0; 252 255 3 4; 1 0 250 255, 0 3 255 255] binary value of dectobin(K,8) is A=11111011111111000000000100000000111111001111111100000000000000110000000000000011111110101111111100000000000001001111111111111111

採用された回答

Walter Roberson
Walter Roberson 2012 年 3 月 7 日
bin2dec(reshape(A,8,[]).')
  2 件のコメント
Walter Roberson
Walter Roberson 2012 年 3 月 7 日
Sorry, I have corrected the code above.
Kaung
Kaung 2012 年 3 月 7 日
wow u are genius man, nice and clean! thanks you so much. It took me the whole day today for just that.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Type Conversion についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by