-
Notifications
You must be signed in to change notification settings - Fork 0
/
cosmo_get_data_path.m
38 lines (32 loc) · 991 Bytes
/
cosmo_get_data_path.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
function data_path=cosmo_get_data_path(subject_id)
% helper function to get the data path.
% this function is to be extended to work on your machine, depending on
% where you stored the test data
%
% Inputs
% subject_id optional subject id identifier. If provided it gives the
% data directory for that subject
%
% Returns
% data_path path where data is stored
% change the following depending on where your data resides
data_path='../../data';
if ismac()
% specific code for NNO
[p,q]=unix('uname -n');
if p==0 && ~isempty(findstr(q,'nicks-MacBook-Pro.local'))
data_path='/Users/nick/git/cosmo_repo2/data/';
end
end
if nargin>=1
if isnumeric(subject_id)
subject_id=sprintf('s%02d', subject_id);
end
data_path=fullfile(data_path, subject_id);
end
if ~exist(data_path,'file')
error('%s does not exist. Did you adjust %s?', data_path, mfilename());
end
if ~isempty(data_path)
data_path=[data_path '/'];
end