how to conver double data type into signed binary in matlab?

10 visualizaciones (últimos 30 días)
vinay pratap srivastava
vinay pratap srivastava el 15 de En. de 2019
Comentada: Guillaume el 15 de En. de 2019
I want to a certain data which is in double format converted into signed binary data type.
I'm providing the data in text file.
I want converted data also in single column matrix form
  3 comentarios
vinay pratap srivastava
vinay pratap srivastava el 15 de En. de 2019
I'm shocked that you actually asked what is "signed binary"
Signed mean first bit represent the sign & later its value.
Positive Signed binary numbers
The binary numbers having their MSB 0 are called “Positive signed binary numbers”.
Negative Signed binary numbers
The binary numbers having their MSB 1 are called “Negative signed binary numbers”.
Guillaume
Guillaume el 15 de En. de 2019
I'm shocked that you actually asked what is "signed binary"
You need to get off your high horse and reflect on the fact that your question is very badly worded.
The concept of signed binary numbers normally applies to integers only. Furthermore, as per my link, there are many ways to store the sign of a binary number, of which using the MSB is but one option. So Adam is correct to ask what is signed binary since you haven't told us which method to use.
Also, you certainly haven't explained how that apply to double numbers which are normally stored using IEEE 754 representation.
Perhaps, you should tell us what exact result you expect for 3.262e-37.

Iniciar sesión para comentar.

Respuestas (1)

Adam
Adam el 15 de En. de 2019
A = A = [-1.9, 1.7, -9, 12 13 -90 0]'
result = sign( A );
will give you -1, 0 or 1 depending on the sign of your data. Here A is just an example obviously. You would load your data in and use that instead.

Categorías

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

Etiquetas

Productos


Versión

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by