FUNCTION REFERENCE

uiputfile

Ask the user for a file name to save to.

Ask the user for a file name to save to.

Syntax

[file, path, indx] = uiputfile(filter, title, defname)

Arguments and results as uigetfile: filter patterns, a window title and a suggested file name that may include a folder. Returns 0, 0, 0 on Cancel. The file is not created; the system picker asks before an existing file is chosen. Needs the desktop app.

Example

[f, p] = uiputfile('*.mat', 'Save results', 'results.mat');

Differences from MATLAB: indx is the first filter that matches the chosen name's extension. When no filter matches the name, indx is 0 and file and path are still returned.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.