12.07.2015 Views

MATLAB Function Reference (Volume 2: Graphics)

MATLAB Function Reference (Volume 2: Graphics)

MATLAB Function Reference (Volume 2: Graphics)

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

uigetfilePurpose2uigetfileInteractively retrieve a filenameSyntaxDescriptionuigetfileuigetfile('FilterSpec')uigetfile('FilterSpec','DialogTitle')uigetfile('FilterSpec','DialogTitle',x,y)[fname,pname] = uigetfile(...)uigetfile displays a dialog box used to retrieve a file. The dialog box lists thefiles and directories in the current directory.uigetfile('FilterSpec') displays a dialog box that lists files in the currentdirectory. FilterSpec determines the initial display of files and can be a fullfilename or include the * wildcard. For example, '∗.m' (the default) causes thedialog box list to show only <strong>MATLAB</strong> M-files.uigetfile('FilterSpec','DialogTitle') displays a dialog box that has thetitle DialogTitle.uigetfile('FilterSpec','DialogTitle',x,y) positions the dialog box atposition [x,y], where x and y are the distance in pixel units from the left andtop edges of the screen. Note that some platforms may not support dialog boxplacement.[fname,pname] = uigetfile(...) returns the name and path of the fileselected in the dialog box. After you press the Done button, fname contains thename of the file selected and pname contains the name of the path selected. Ifyou press the Cancel button or if an error occurs, fname and pname are set to 0.RemarksExamplesIf you select a file that does not exist, an error dialog appears. You can thenenter another filename, or press the Cancel button.This statement displays a dialog box that enables you to retrieve a file. Thestatement lists all <strong>MATLAB</strong> M-files within a selected directory. The name andpath of the selected file are returned in fname and pname.[fname,pname] = uigetfile('*.m','Sample Dialog Box')The exact appearance of the dialog box depends on your windowing system.2-556

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!