Last change
on this file since 4 was
4,
checked in by zhangj, 10 years ago
|
Initial import--MML version from SOLEIL@2013
|
File size:
842 bytes
|
Line | |
---|
1 | function MMLROOT = getmmlroot(varargin) |
---|
2 | %GETMMLROOT - Returns root directory of the Matlab Middle Layer |
---|
3 | % MMLRootDirectory = getmmlroot |
---|
4 | % |
---|
5 | % Written by Greg Portmann |
---|
6 | |
---|
7 | |
---|
8 | MMLROOT = ''; |
---|
9 | |
---|
10 | |
---|
11 | % This is legacy |
---|
12 | MMLROOT = getenv('MLROOT'); |
---|
13 | |
---|
14 | if isempty(MMLROOT) |
---|
15 | %if exist('getsp','file') |
---|
16 | % % Base on getsp file |
---|
17 | % [MMLROOT, FileName, ExtentionName] = fileparts(which('getsp')); |
---|
18 | %else |
---|
19 | % Base on the location of this file |
---|
20 | [MMLROOT, FileName, ExtentionName] = fileparts(mfilename('fullpath')); |
---|
21 | %end |
---|
22 | MMLROOT = [MMLROOT, filesep]; |
---|
23 | end |
---|
24 | |
---|
25 | % End MMLROOT with a file separator |
---|
26 | if ~strcmp(MMLROOT(end), filesep) |
---|
27 | MMLROOT = [MMLROOT, filesep]; |
---|
28 | end |
---|
29 | |
---|
30 | |
---|
31 | % Make MMLROOT root 1 up from the MML directory |
---|
32 | i = findstr(MMLROOT, filesep); |
---|
33 | if length(i) < 2 |
---|
34 | MMLROOT = MMLROOT; |
---|
35 | else |
---|
36 | MMLROOT = MMLROOT(1:i(end-1)); |
---|
37 | end |
---|
38 | |
---|
39 | |
---|
40 | |
---|
41 | |
---|
Note: See
TracBrowser
for help on using the repository browser.