Azzera filtri
Azzera filtri

Info

Questa domanda è chiusa. Riaprila per modificarla o per rispondere.

three sequences with bits,Can you show me possibility?

1 visualizzazione (ultimi 30 giorni)
Milos Kopec
Milos Kopec il 5 Dic 2018
Chiuso: MATLAB Answer Bot il 20 Ago 2021
random generated 0 and 1 in 3 sequences
I have 3 sequnces for 8 bits
My desired result :
black dots - bits stay on position
B2,C2 ,A2 A5 etc ,bits are replaced among sequences...
Does exist command/tutorial/video etc how to make it? I really dont know how to find the answer...

Risposte (1)

Walter Roberson
Walter Roberson il 5 Dic 2018
Use bitget() and bitset()
  5 Commenti
Milos Kopec
Milos Kopec il 6 Dic 2018
yes, but I didnt know how to use them, probably I wrote it bad, I using this code :
clear all
clc
x = randi([0 1],24,1) ;
iwant = reshape(x,[8,3]) ;
A = iwant(:,1)
B = iwant(:,2)
C = iwant(:,3) ;
newA = bitset(A, 5, bitget(B, 3)) %set bit 5 of A to bit 3 of B
For me it looks that it is not working well,but I'm probably wrong, Can u check it please
command window :
A =
1
0
0
0
1
0
0
0
B =
1
1
1
0
1
0
1
0
newA =
1
0
0
0
1
0
0
0

Questa domanda è chiusa.

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by