Edit:Replacing 5 bits in Binary value

1 回表示 (過去 30 日間)
kash
kash 2012 年 11 月 22 日
I have values
say A=[1056;1078]
B=[31;25];
i tried using
for i=1:2 C(n:n+numel(D)-1)=D; end
but not getting the answer,please assist
  1 件のコメント
Matt Fig
Matt Fig 2012 年 11 月 22 日
編集済み: Matt Fig 2012 年 11 月 22 日
What do A and B have to do with C and D? And what is "the answer" supposed to be? Where is n defined? If you want good help, ask a good question!

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

採用された回答

Andrei Bobrov
Andrei Bobrov 2012 年 11 月 22 日
編集済み: Andrei Bobrov 2012 年 11 月 22 日
A=[1056;1078]
B=[31;25];
C = decbin(A,11);
D = dec2bin(B,4);
n = 4;
C(:,n : n + size(D,2) - 1) = D

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSignal Analysis についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by