restoredefaultpath — Restore the session's captured startup search path.
restoredefaultpath() resets the active ordered search path to its captured startup layers: the application user-path setting, configured environment paths, and the known RunMat installation path. The current folder remains an implicit lookup location. A requested path output is a RunMat extension; the MATLAB-compatible form is statement-only.
Syntax
restoredefaultpath()
path = restoredefaultpath()Returns
path- Type
StringScalar- Description
- The restored ordered search path as a character row.
Errors
RunMat:restoredefaultpath:InvalidCall- When
- An input is supplied.
- Message
restoredefaultpath: too many input arguments
RunMat:restoredefaultpath:TooManyOutputs- When
- More than one output is requested.
- Message
restoredefaultpath: too many output arguments
RunMat:restoredefaultpath:StaleUserPath- When
- The application user-path setting must be rehydrated before restoration.
- Message
restoredefaultpath: user path is stale
RunMat:RuntimeContext:CapabilityUnavailable- When
- The host has no session search-path service.
- Message
restoredefaultpath: ordered search-path service is unavailable
Session baseline
Restoration uses the session's captured startup baseline rather than rereading the process working directory or current environment. A project or manifest source inventory has separate ownership and is not cleared by this search-path operation.
Changes made by path, addpath, and rmpath to the current search path are removed. restoredefaultpath does not change the durable application user-path setting; use userpath('reset') to reset that setting.
Host requirements
The application user-path setting must be hydrated before source resolution. If a prior application-store outcome left the local user path stale, the host must rehydrate it before restoration rather than restoring an obsolete entry.
Example
Restore the captured startup path
restored = restoredefaultpath();
assert(ischar(restored));
assert(strcmp(path(), restored));Using restoredefaultpath with coding agents
Open a RunMat example with live inputs, then ask the agent to explain how restoredefaultpath changes the result.
Run a small restoredefaultpath example, explain the result, then change one input and compare the output.
FAQ
Does this clear the current folder?⌄
No. The current folder is an implicit source lookup location, separate from the ordered search path.
Does this reset the stored user path?⌄
No. It restores the session path using the current stored setting; userpath('reset') changes the application setting.
Related Io functions
Repl Fs
addpath · cd · copyfile · delete · dir · exist · fileattrib · fileparts · filesep · fullfile · genpath · getenv · getpref · isenv · isfile · isfolder · ispref · ls · matlabroot · memmapfile · memmapfile.subsasgn · memmapfile.subsref · mkdir · movefile · open · opentoline · path · pathsep · pcode · pwd · readstruct · rehash · rmdir · rmpath · run · savepath · setenv · setpref · system · tempdir · tempname · uigetdir · uigetfile · uiputfile · unsetenv · userpath · what · winqueryreg · xmlread · xmlwrite
Tabular
arrayDatastore · csvread · csvwrite · detectImportOptions · dlmread · dlmwrite · fileDatastore · getvaropts · parquetDatastore · parquetinfo · parquetread · readcell · readmatrix · readtable · readtimetable · setvaropts · setvartype · spreadsheetImportOptions · writecell · writematrix · writetable · writetimetable · xlsread · xlswrite
Data
commit · data.copy · data.create · data.delete · data.exists · data.export · data.import · data.inspect · data.list · data.move · data.open · DataArray.chunk_shape · DataArray.codec · DataArray.dtype · DataArray.fill · DataArray.name · DataArray.rank · DataArray.read · DataArray.resize · DataArray.shape · DataArray.write · Dataset.array · Dataset.arrays · Dataset.attrs · Dataset.begin · Dataset.get_attr · Dataset.has_array · Dataset.id · Dataset.path · Dataset.refresh · Dataset.set_attr · Dataset.set_attrs · Dataset.snapshot · Dataset.version · DataTransaction.abort · DataTransaction.commit · DataTransaction.create_array · DataTransaction.delete_array · DataTransaction.fill · DataTransaction.id · DataTransaction.resize · DataTransaction.set_attr · DataTransaction.set_attrs · DataTransaction.status · DataTransaction.write
Filetext
fclose · feof · fgetl · fgets · fileread · filewrite · fopen · fprintf · fread · frewind · fwrite · readlines · writelines
Import
Json
Source you can read
Every RunMat function's source is public. Read exactly how restoredefaultpath is executed, line by line, in Rust.
- View the source for restoredefaultpath in Rust on GitHub
- Learn how the RunMat runtime works
- Found a bug? Open an issue with a minimal reproduction.
About RunMat
RunMat is a runtime that executes MATLAB-syntax code fast on any GPU. The runtime is free for individuals, including freelancers; students and faculty at an academic institution, for teaching or research there; contributors to an open-source project, for work on that project; organizations with 250 or fewer people and US$10M or less in annual revenue; and anyone, for non-production use. See runmat.com/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.