Saving my Plot as Jpg not working

9 views (last 30 days)
Abdelhakim Souit
Abdelhakim Souit on 26 Oct 2018
Answered: Image Analyst on 26 Oct 2018
I´m currently writing a program that´ll take data from an experiment and then save its plot. Sadly it doesnt wanna save it and I keep getting errors. The program is taking 2 columns of a CSV, plot them and should (even though it doesnt wanna work) save them. You guys will find the csv file as well as the program attached to this. Thanks for taking the time to read my Problem

Answers (2)

Star Strider
Star Strider on 26 Oct 2018
I’m not sure what you want to do. I don’t see any commands in you code to save anything.
If you want to save your plot or an image of it, use the saveas (link) function, or one of the other functions linked within or at the end of that page.

Image Analyst
Image Analyst on 26 Oct 2018
What are the errors? You forgot to post them. Please attach all the red error text.
I ran it and it ran fine. I saved it from the toolbar icon into a PNG file:
I recommend you use export_fig http://blogs.mathworks.com/pick/2010/05/28/creating-and-exporting-publication-quality-graphics/ to save the axes or figure into a PNG file. No one likes JPG files anymore because of the bad compression artifacts it introduces.
I do praise you for writing pretty good code though. I like all the numerous comments in there and the use of descriptive variable names (not an impenetrable alphabet soup).

Categories

Find more on Scripts in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!