Search code examples
matlabfile-ioinputbinaryfilesfile-format

Loading a file into MATLAB as it is?


I'm working on a telecommunications device simulator on MATLAB. I'm going to encode some digital data, modulate it, add some noise and attempt to demodulate it, see at what noise levels my data cannot be recovered anymore.

My problem is, I don't know how to import some crazy file to my workspace. It's not going to be txt or anything, just some file. How can I make MATLAB read the file in binary format or whatever it is called?


Solution

  • It turns out I was using the right function with wrong parameters all along. I opened the file I wanted to open with fopen('filename') and used the number that function outputs in A=fread(thenumber). That returned an array of each and every byte in the file by their decimal values. I'm sure I'll be able to use this data for my project.

    Thanks to everybody for their help!