フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

p=4 and b1=dec2bin(p,8) now b1='00000100' and iwant now b1= 0000 first raw & 01000 second raw 2*4 size matrix from binary digit number

1 回表示 (過去 30 日間)
Pratik Anandpara
Pratik Anandpara 2016 年 12 月 8 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
8 digit binary to 4 digit group and make matrix from it b1= 0 0 0 0(first raw) 0 0 0 1(second raw) b2= 0 0 0 0 1 0 1 0 2*4 size matrix

回答 (1 件)

KSSV
KSSV 2016 年 12 月 8 日
b = '00000001' ;
B = b - '0' ;
iwant = reshape(B,2,4)
  5 件のコメント
Pratik Anandpara
Pratik Anandpara 2016 年 12 月 8 日
編集済み: Pratik Anandpara 2016 年 12 月 8 日
reshape(dec2bin(6,8)-'0',4,2).' i also try this but this is valid for some digit if we do for reshape(dec2bin(4,8)-'0',4,2).' than answer is correct
KSSV
KSSV 2016 年 12 月 8 日
p1 = 4 ;
b = num2str(dec2bin(p1,8));
B = b - '0' ;
iwant = reshape(B,2,4)

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by