Convert a matrix from Ascii to binary

1 view (last 30 days)
Deli
Deli on 20 Mar 2014
Commented: Deli on 20 Mar 2014
I have a matrix, dimensions 17272 x 9, and i want to convert it into a binary file. The matrix includes negative elements!! Can anyone help?
  1 Comment
dpb
dpb on 20 Mar 2014
Edited: dpb on 20 Mar 2014
What's it look like, how's it stored?

Sign in to comment.

Answers (1)

Walter Roberson
Walter Roberson on 20 Mar 2014
outputfid = fopen('YourFile.bin', 'w');
fwrite(outputfid, YourArray);
fclose(outputfid);
The above creates a binary file.
Note: a "binary file" is not the same thing as a file in which each byte of the file is used to represent one bit of the data, such as '00010011'
  1 Comment
Deli
Deli on 20 Mar 2014
Thank you Walter, it's pretty much it! And what I need is exactly a binary file :)

Sign in to comment.

Categories

Find more on Data Type Conversion in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!