I have a GUI with inputs and a plot. I want to print this ideally to PDF. Is this possible?
Thanks
Best Answer
A - a GUI is a figure, so you can useprint to save it as an image or as a PDF. For example, I would launch my GUI as
h = myGui;
whereh is the handle to the GUI. Then to print this to file, I would use
print(h,'myGuiImageFilename','-dpdf');
or whichever format you wish. You may find that some experimentation is required to get the image of the GUI to appear as desired. Sometimes, it is just easier to do a (for example) Windows or Mac screen capture of the (running) GUI and use that captured image within your file.
If this occurs from within a pushbutton callback of the GUI, then there is no need for theh parameter. You could just use the GUI figure handle instead
function pushbutton_Callback(hObject, eventdata, handles)
Best Answer