Edit:Replacing 5 bits in Binary value

조회 수: 15 (최근 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 CenterFile Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by