uigetdir — Open a host folder-selection dialog and return the selected folder path.
uigetdir requests a folder selection from the active RunMat filesystem provider and returns MATLAB-compatible output values. Interactive hosts can implement the provider hook to show a native or browser folder picker; noninteractive hosts return the standard cancellation value.
Syntax
folder = uigetdir(pwd, 'Select input image folder');GPU memory and residency
No. Folder-selection dialogs are host/UI operations and always execute outside GPU residency. Textual arguments are gathered before provider dispatch.
Examples
Prompt for a folder and list its contents unless the dialog is cancelled.
folder = uigetdir;
if isequal(folder, 0)
return;
end
listing = dir(folder);Use the current folder as the initial location and set a dialog title.
folder = uigetdir(pwd, 'Select input image folder');Using uigetdir with coding agents
Open a RunMat example with live inputs, then ask the agent to explain how uigetdir changes the result.
Run a small uigetdir example, explain the result, then change one input and compare the output.
Related Io functions
Repl Fs
addpath · cd · copyfile · delete · dir · exist · fileattrib · fileparts · fullfile · genpath · getenv · getpref · isenv · isfile · isfolder · ispref · ls · matlabroot · memmapfile · mkdir · movefile · open · opentoline · path · pathsep · pcode · pwd · readstruct · rehash · restoredefaultpath · rmdir · rmpath · run · savepath · setenv · setpref · system · tempdir · tempname · uigetfile · uiputfile · unsetenv · userpath · what · winqueryreg · xmlread · xmlwrite
Tabular
arrayDatastore · csvread · csvwrite · detectImportOptions · dlmread · dlmwrite · fileDatastore · parquetDatastore · parquetinfo · parquetread · readcell · readmatrix · readtimetable · spreadsheetImportOptions · writecell · writematrix · writetable · writetimetable · xlsread · xlswrite
Filetext
fclose · feof · fgetl · fgets · fileread · filewrite · fopen · fprintf · fread · frewind · fwrite · readlines · writelines
Import
Json
Open-source implementation
Unlike proprietary runtimes, every RunMat function is open-source. Read exactly how uigetdir is executed, line by line, in Rust.
- View the source for uigetdir in Rust on GitHub
- Learn how the RunMat runtime works
- Found a bug? Open an issue with a minimal reproduction.
About RunMat
RunMat is an open-source runtime that executes MATLAB-syntax code blazing on any GPU. It is licensed under the Apache 2.0 license.
- RunMat automatically optimizes your math for GPU execution on Apple, Nvidia, and AMD hardware. No code changes needed. Simulations that took hours now take minutes.
- Start running code in seconds. RunMat runs in the browser, on the desktop, or from the CLI. No license server, no IT ticket.