I have a .txt file of 16 bit binary numbers. However, the numbers are stored as bytes seperated by spaces, ex. 00001111 00001111 11110000 11110000 are the decimal numbers 3855 and 61680. I want Matlab to read the text file, removing every other space to form seamless 16bit binary numbers. I then want these 16bit binary numbers to be converted into signed 16 bit integer using signed 2's compliment.
I know that I can use fopen and fileread to read the numbers from the file, but I don't know how to remove every other space to form seamless 16bit binary numbers. I am also not sure how to properly convert from 16bit binary (signed 2's compliment) to signed 16 bit integers.
I have included an example .txt file. The decimal representations of the numbers are 2, 64, 128, and 2048.
Any help regarding what functions/algorithms to use is greatly appreciated.