2%> Return a MATLAB
string containing the
3%> absolute path to the system
home directory.<br>
6%> ``path`` : A MATLAB
string containing the
7%> absolute path to the system
home directory.<br>
12%> path = pm.sys.path.home()
17%> \include{lineno} example/sys/path/
home/main.m
19%> \include{lineno} example/sys/path/
home/main.out.m
24%> \JoshuaOsborne, May 21 2024, 5:25 AM, University of Texas at Arlington<br>
25%> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
26%> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute
for Computational Engineering and Sciences (ICES), UT Austin<br>
28 persistent homePathPersistent
29 %freshRequested = false;
31 % if isempty(homePathPersistent); freshRequested = true; end
32 %elseif nargin==1 && ( strcmpi(
string(varargin{1}),
"fresh") || strcmpi(
string(varargin{1}),
"new") || strcmpi(
string(varargin{1}),
"reset") )
33 % freshRequested =
true;
35 % error(
"home() takes at most one argument of the following values: ""new"", ""fresh"", ""reset"", all with the same meaning." );
39 [failed, homePathPersistent] = system(
"echo %HOMEPATH%");
43 +
"Failed to capture the path to the home directory of the Windows system." + newline ...
44 +
"This is highlt unusual and likely a low-level MATLAB problem." + newline ...
48 homePathPersistent = strtrim(homePathPersistent);
51 homePathPersistent = strtrim(pm.sys.path.abs(
"~"));
54 path = string(homePathPersistent);
function home()
Return a MATLAB string containing the absolute path to the system home directory.