Add figure to .txt file using fprintf
Show older comments
I'm writing my semester gpa and cumulative gpa to a .txt file for each semester for fun/records. I have it all done but decided I needed a plot to show the trends of my gpa. I was wondering if there was a way to write the figures into the .txt from matlab using fprintf.
Accepted Answer
More Answers (1)
Sulaymon Eshkabilov
on 13 May 2019
0 votes
Hi,
It is possible to do it.
(1) If you shall save your plot as *.jpg, jpeg, *.tiff, *.... etc. image file;
(2) you shall read it via imread();
(3) now, you can export/write your read data in MATLAB into *.dat, *.txt, *.xls, ... etc file formats using fprintf(), dlmwrite(), xlswrite(), ...
Good luck.
1 Comment
Justin Western
on 14 May 2019
Categories
Find more on Creating, Deleting, and Querying Graphics Objects 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!