Home > vbmeg > external > mne > mne_file_name.m

mne_file_name

PURPOSE ^

SYNOPSIS ^

function [res] = mne_file_name(dir,name)

DESCRIPTION ^

   [name] = mne_file_name(dir,name)

   Compose a file name under MNE_ROOT

   dir     - Name of the directory containing the file name
   name    - Name of the file under that directory

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [res] = mne_file_name(dir,name)
0002 %
0003 %   [name] = mne_file_name(dir,name)
0004 %
0005 %   Compose a file name under MNE_ROOT
0006 %
0007 %   dir     - Name of the directory containing the file name
0008 %   name    - Name of the file under that directory
0009 %
0010 
0011 %
0012 %   Author : Matti Hamalainen, MGH Martinos Center
0013 %   License : BSD 3-clause
0014 %
0015 %
0016 
0017 me='MNE:mne_file_name';
0018 
0019 if ~ispref('MNE','MNE_ROOT')
0020     mne_root = getenv('MNE_ROOT');
0021     if isempty(mne_root)
0022         error(me,'MNE_ROOT not defined');
0023     end
0024 else
0025     mne_root=getpref('MNE','MNE_ROOT');
0026 end
0027 
0028 if nargin == 2
0029     res = sprintf('%s/%s/%s',mne_root,dir,name);
0030 elseif nargin == 1
0031     res = sprintf('%s/%s',mne_root,dir);
0032 else
0033     error(me,'incorrect number of arguments');
0034 end 
0035 
0036 return;
0037 
0038 end
0039

Generated on Mon 22-May-2023 06:53:56 by m2html © 2005