how to convert 2 double number and packed in 32 bit
13 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
hi i want to convert 2 double number 0.5 and -0.5 in 16 bit and packed into 32 bit. each number in double takes 8 bytes. i want to convert in this number in fixed point 16,14 (2 bytes). and finally i want to packed these 2 number in 32 bit(4 bytes). please tell me how i can do this operation in matlab
2 comentarios
Walter Roberson
el 21 de Ag. de 2015
Does 16,14 indicate 1 sign bit, then 1 bit of integer, then 14 bits of fraction? Or do you want to use 2s complement?
Respuestas (1)
Walter Roberson
el 21 de Ag. de 2015
Editada: Walter Roberson
el 21 de Ag. de 2015
typecast(int16(x*2^14),'uint32')
is one possibility depending on what you mean by 16,14
3 comentarios
Walter Roberson
el 24 de Ag. de 2015
typecast(storedInteger([FirstFi, SecondFi]),'uint32')
or you might need
typecast([storedInteger(FirstFi), storedInteger(SecondFi)], 'uint32')
Ver también
Categorías
Más información sobre Data Type Conversion 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!