MATLAB: Does filemenufcn have properties

filemenufcn exploitation

filemenufcn lets me save figure images so they can be stored and printed just as I want. Tne property(?) 'FileSaveAs' is all I can find. For configuration mgt purposes I need for the code to specify the file name and the save to occur by code as well. I realize filemenufcn is undocumented, but has anyone used it to save from code rather than the user havingf to act by naming the new file and hitting "save".

Best Answer

If you have R2014a or earlier, you can edit or type the filemenufcn function.
It looks to me as if for image files the code would come down to
hgexport(Handle, Filename, hgexport('factorystyle'), 'Format', TYPE)
where TYPE is the driver name that would be used in print() . If you are not using a postscript or pdf format then (at least on my system) that would be one of 'jpeg', 'pcx24b', 'pbm', 'pgn', 'png', 'ppm', 'tiff', 'tiffnocompression'
The undocumented hgexport('factorystyle') appears to be the key to differentiating using the file menus from doing a saveas() in code.