Edit:Replacing 5 bits in Binary value

14 vues (au cours des 30 derniers jours)
kash
kash le 22 Nov 2012
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 commentaire
Matt Fig
Matt Fig le 22 Nov 2012
Modifié(e) : Matt Fig le 22 Nov 2012
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!

Connectez-vous pour commenter.

Réponse acceptée

Andrei Bobrov
Andrei Bobrov le 22 Nov 2012
Modifié(e) : Andrei Bobrov le 22 Nov 2012
A=[1056;1078]
B=[31;25];
C = decbin(A,11);
D = dec2bin(B,4);
n = 4;
C(:,n : n + size(D,2) - 1) = D

Plus de réponses (0)

Catégories

En savoir plus sur Introduction to Installation and Licensing dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by