how to convert a cell containig 8bit niary sequence to integer value

2 ビュー (過去 30 日間)
Abirami
Abirami 2014 年 8 月 24 日
編集済み: Azzi Abdelmalek 2014 年 8 月 24 日
Hello i need to convert an 8bit binary sequence into decimal. i used the bin2dec function but somehow the results are all 1..
A='01001100' '01011110' '00110110' '11110000' '00111110'
'10010100' '01100000' '01000000' '00110101' '11110010'
'10011100' '00101101' '11011100' '11111000' '01010101'
'10010010' '10000001' '01000111' '01000010' '00100001'
'10111010' '00011000' '01100001' '10001101' '10100000'
i used the folowing code to convert this to decimal values..
for i=1:1:256
for j=1:1:256
P{i,j,1} = bin2dec(A(i,j));
end
end
disp(P);
pls help....thanks in advance..

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2014 年 8 月 24 日
編集済み: Azzi Abdelmalek 2014 年 8 月 24 日
A={'01001100' '01011110' '00110110'
'10010100' '01100000' '01000000'
'10011100' '00101101' '11011100'}
B=cellfun(@bin2dec,A)

その他の回答 (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