source: MML/trunk/mml/getmmlroot.m @ 4

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 
1function MMLROOT = getmmlroot(varargin)
2%GETMMLROOT - Returns root directory of the Matlab Middle Layer
3%  MMLRootDirectory = getmmlroot
4%
5%  Written by Greg Portmann
6
7
8MMLROOT = '';
9
10
11% This is legacy
12MMLROOT = getenv('MLROOT');
13
14if 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];
23end
24
25% End MMLROOT with a file separator
26if ~strcmp(MMLROOT(end), filesep)
27    MMLROOT = [MMLROOT, filesep];
28end
29
30
31% Make MMLROOT root 1 up from the MML directory
32i = findstr(MMLROOT, filesep);
33if length(i) < 2
34    MMLROOT = MMLROOT;
35else
36    MMLROOT = MMLROOT(1:i(end-1));
37end
38
39
40
41
Note: See TracBrowser for help on using the repository browser.