Byte manipulation and Endian conversion in MATLAB
by Gautam Vallabha
16 Nov 2007
(Updated 19 Nov 2007)
A demonstration of MATLAB's built-in facilities for unpacking integers into individual bytes (and vi
|
Watch this File
|
| File Information |
| Description |
MATLAB has several function that allow byte-level manipulation of numeric data types (such as DOUBLE, INT32, or UINT16). These can be used to easily convert a multibyte integer into individual bytes or vice versa, check the endian-ness of a system, or convert between big and little-endian formats.
This submission consists of an m-file (ByteConversion.m) and its published HTML version (ByteConversion.html). These files demonstrate the different byte-manipulation abilities.
Table of Contents
-----------------
* Creating an integer variable
* Destructive casting - I
* Destructive casting - II
* Non-destructive casting
* Converting an integer to a sequence of bytes
* Converting a floating-point value to a sequence of bytes
* Converting a sequence of bytes to an integer
* Checking the Endianness of the system
* Little-endian and Big-endian conversions
* Help on functions |
| MATLAB release |
MATLAB 7.5 (R2007b)
|
| Other requirements |
The m-file was tested on R2007b (MATLAB 7.5), but the key functions have been available since R14 (MATLAB 7.0). |
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Comments and Ratings (2) |
| 22 Jan 2008 |
Arne Michaelsen
|
|
|
| 03 Jun 2009 |
Max
|
|
|
|
Contact us at files@mathworks.com