Navigation

Operators and Keywords

Function List:

C++ API

: [fname, fpath, fltidx] = uiputfile ()
: [fname, fpath, fltidx] = uiputfile (flt)
: [fname, fpath, fltidx] = uiputfile (flt, dialog_name)
: [fname, fpath, fltidx] = uiputfile (flt, dialog_name, default_file)

Open a GUI dialog for selecting a file.

flt contains a (list of) file filter string(s) in one of the following formats:

"/path/to/filename.ext"

If a filename is given the file extension is extracted and used as filter. In addition the path is selected as current path and the filename is selected as default file. Example: uiputfile ("myfun.m")

"*.ext"

A single file extension. Example: uiputfile ("*.ext")

{"*.ext", "My Description"}

A 2-column cell array containing the file extension in the 1st column and a brief description in the 2nd column. Example: uiputfile ({"*.ext","My Description";"*.xyz", "XYZ-Format"})

The filter string can also contain a semicolon separated list of filter extensions. Example: uiputfile ({"*.gif;*.png;*.jpg", "Supported Picture Formats"})

dialog_name can be used to customize the dialog title. If default_file is given it is preselected in the GUI dialog. If, in addition, a path is given it is also used as current path.

See also: uigetfile, uigetdir.

Demonstration 1

The following code

 uiputfile ({'*.gif;*.png;*.jpg', 'Supported Picture Formats'});

gives an example of how 'uiputfile' is used.

Package: octave