Clear Filters
Clear Filters

how to write binary image into text file

1 view (last 30 days)
hello, i want to write binary image into a text file. thank u

Accepted Answer

David Sanchez
David Sanchez on 28 Nov 2013
M = your_matrix_with_image_data;
fid = fopen('your_binary_im.txt', 'w+');
for i=1:size(M, 1)
fprintf(fid, '%f ', M(i,:));
fprintf(fid, '\n');
end
fclose(fid);
  3 Comments
Walter Roberson
Walter Roberson on 4 Dec 2013
Really that should go into a different Question.
SUMEET
SUMEET on 4 Jun 2014
search on matlab central with link: Edge detection using sobel operator

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!