Taking a Screenshot using Matlab!

Hi,

There are certain requirements while creating a Matlab GUI , to export the details of the results and analysis for generating a report or to use them for further processing on any other IDE . I have come across certain functions that might embed all the contents of your need into a word document and save it automatically.But most of them are tedious to use and requires modifications in the main .m file itself.

Even there are report generating toolboxes which are not present by default.

http://www.mathworks.in/products/ML_reportgenerator/

As  a simple solution I have come across a code on Matlab Central to click a screenshot of your GUI Front panel and save it as an image. The submission was done in 2009 by the author and is now updated in 2013.

1. Simply, save the function in the same folder as that of your .fig file and .m file

2. Then, there are certain command prototypes which you can use, listed.

3. Mention this command under the callback function of Pushbutton which you want to screen capture for you.

You can select the area which you want to capture and the format in which the image can be saved.

http://www.mathworks.in/matlabcentral/fileexchange/24323-screencapture-get-a-screen-capture-of-a-figure-frame-or-component

The above attached is the link of the submission from Matlab Central.

Its simple to use but an effective function.

Cheers..!



Leave a comment