Interactively select file to open and load data
uiopen(type) sets the file filter according to the type.
uiopen(filename) displays filename as the default value for File name in the dialog box and lists only files having the same extension.
String that specifies the kind of file to show in the dialog box (the file filter). Acceptable values for type are the following.
A string, including the file extension, naming a file to open. The filename can be a wildcard character plus extension. For example, *.txt displays a list of all files with the file extension .txt.
A MATLAB expression that evaluates to true or false. If true, filename opens directly, without displaying the dialog.
Filter to display only FIG-files by setting the Files of type field to Figures (*.fig):
In MATLAB code or in a command:
To open a file appropriately based on its file extension, use the open function.
To open a file in the Editor, use the edit function.
To open a MAT-file and load its contents into the workspace, use the load function.
To open a FIG-file, use the openfig function.
To open a file in an application in Microsoft® Windows®, use the winopen function.
A modal dialog box prevents the user from interacting with other windows before responding. For more information, see WindowStyle in the MATLAB Figure Properties.
When you select a file and click open, uiopen does the following:
Gets the file using uigetfile.
Opens the file using the open command.
Files with a file extension of .m open in the Editor.
Variables stored in files with a file extension of .mat appear in the caller's workspace.
Files with a file extension of .fig open as figure windows.
Files with a file extension of .mdl or .slx open as models in Simulink.
uiopen('load') is the only the form of uiopen that you can compile into a standalone application. You can create a file selection dialog box that you can compile using uigetfile.
The uiopen dialog box is modal. A modal dialog box prevents you from interacting with other windows until you respond to the modal one.
uiopen displays the same dialog box that opens when you use the MATLAB desktop toolstrip to open a file. (On the Home tab, in the File section, click Open .)