I am reading data from device from ethernet into matlab. Device sending fraction of seconds in 4-byte format. Following are the 4-byte uint8 fracsec value and their decimal representation.
000 000 000 000 represents 0
000 025 153 154 represents either 100000 or 0.1
000 051 051 051 represents either 200000 or 0.2
000 076 204 205 represents either 300000 or 0.3
000 102 102 102 represents either 400000 0r 0.4
000 128 000 000 represents either 500000 or 0.5
While converting from uint8 to uint32, it is not giving the correct value.
swapbytes(typecast(uint8([0 128 0 0]),'uint32')) gives 8388608 but this is equal to 500000.
How to get the correct value. thankyou