3 bit binary signal to numerical value

6 visualizaciones (últimos 30 días)
Yusuf Dhoda
Yusuf Dhoda el 9 de Sept. de 2019
Comentada: Adam Danz el 9 de Sept. de 2019
I have a 32768x3 double array that contains a 3 bit binary signal. I want to convert this 3 bit binary signal to a value between 1 and -1. For example:
111 ----- 0.75
110 ----- 0.5
101 ----- 0.25
100 ----- 0
011 ----- -0.25
010 ----- - 0.5
001 ----- - 0.75
000 ----- - 1
I want to store the results in a 32768x1 array
Thank you

Respuesta aceptada

Walter Roberson
Walter Roberson el 9 de Sept. de 2019
YourArray(:,1) + YourArray(:,2) / 2 + YourArray(:,3) / 4 - 1
  2 comentarios
Yusuf Dhoda
Yusuf Dhoda el 9 de Sept. de 2019
Thank you so much!
Adam Danz
Adam Danz el 9 de Sept. de 2019
Nice! +1

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Logical en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by