imputfile

Display Save Image dialog box

Syntax

[filename, ext, user_canceled] = imputfile

Description

[filename, ext, user_canceled] = imputfile displays the Save Image dialog box (shown below) which you can use to specify the full path and format of a file. Using the dialog box, you can navigate to folders in a file system and select a particular file or specify the name of a new file. imputfile limits the types of files displayed in the dialog box to the image file format selected in the Files of Type menu.

When you click Save, imputfile returns the full path to the file in filenameand the file type selected from the Files of Type menu in ext. imputfile does not automatically add a file name extension (such as .jpg) to the file name.

If the user clicks Cancel or closes the Save Image dialog box, imputfile returns, setting user_canceled to True (1), and settingfilename and ext to empty strings; otherwise, user_canceled is False (0).

    Note:   The Save Image dialog box is modal; it blocks the MATLAB® command line until you click Save or cancel the operation.

Was this topic helpful?