Convert byte to double
Ältere Kommentare anzeigen
Hi, I have somae data in a byte format that i want to convert to double format. Does anyone know how to do this in matlab?
I have read the data in to a char, where every 8 characters should represent a double.
My data looks like this :
QAAAAAAAaIBAAAAAAADQgUAAAAAAAHCCQAAAAAAAsINAAAAAAAAohEAAAAAAAKCEQAAAAAAA4IVAAAAAAABgiEAAAAAAAJCKQAAAAAAAMItAAAAAAADQi0AAAAAAAGCNQAAAAAAAUI5A
/Malte
1 Kommentar
David Young
am 9 Jan. 2012
Do you have any more information about how the numbers are coded? It's odd that there are only letters displayed, and there seem to be more than 8 characters per value judging from the periodicity. Showing the value of double(data), where data is your character string, might help.
Akzeptierte Antwort
Weitere Antworten (1)
Jan
am 9 Jan. 2012
1 Stimme
Is there a good reason not to read the data in double format directly?
Usually typecast performs a binary conversion.
1 Kommentar
Geoffrey
am 9 Apr. 2025
The "typecast" function is useful for things like converting a string of bytes (stored as a uint8 vector for example) into other data types.
Kategorien
Mehr zu Data Type Conversion finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!