I have a 516096x1 vector with data samples that are all integer decimal values that looks like this but only the decimal column:
(DECIMAL)
1416
258
-258
2189
1545
I stored them into a variable. Now I want to write that variable to a binary file. The problem is, when I write the variable into a file, it replaces certain values incorrectly.
my code is:
Samples = (all the 516096 samples)
fwrite(fid1, Samples, 'int16')
It will write all the integers to the file in hex (using hex editor) but whenever it reaches the decimal integer that's equivalent to 8D it replaces it with 3F in the hex editor. 8F gets changed to 3F and 81 gets changed to 3F. also 0A gets replaced with 0D. why does Matlab do that. I've read it in as int16 and wrote it as int16.