Master Thesis Code
by Simon Moser
Loading...
Searching...
No Matches
getDataPath.m
Go to the documentation of this file.
1% =========================================================================== %
2%> @brief returns the path to the data folder
3%>
4%> measured sensor data is stored in the data folder. The data folder is located
5%> in the OneDrive folder of moss. Since the exact location of the OneDrive
6%> folder depends on the computer name, this function returns the path to the
7%> data folder depending on the computer name. This function is used by the
8%> functions that load the sensor data.
9%>
10%> @param none
11%>
12%> @retval dataPath - path to the data folder
13%>
14%> @remark Ask moss to get access to the data folder. In some later time, the
15%> data folder will pobbibly will have been moved to a different location, e.g.
16%> to the strassburg server. In this case, the function has to be adapted.
17%>
18%> @file getDataPath.m
19%>
20%> @copyright see the file @ref LICENSE in the root directory of the repository
21% =========================================================================== %
22
23% GET_DATA_PATH Returns the path to the data folder.
24%
25% Returns the path to the data folder depending on the computer name.
26% If the computer name is unknown, an error is thrown.
27%
28% Example:
29% dataPath = get_data_path();
30%
31% Output:
32% dataPath - Path to the data folder.
33%
34% See also: system, strtrim, switch, error
35%
36% For LICENSE / TERMS OF USE, see the file LICENSE in the root directory of the repository.
37
38function dataPath = getDataPath()
39% Get the computer name
40[~, computerName] = system('hostname');
41computerName = strtrim(computerName);
42
43% Determine the data path based on the computer name
44switch computerName
45 case 'Simons-Macbook.lan'
46 dataPath = '/Users/simonmoser/Library/CloudStorage/OneDrive-ZHAW/MT/Measurements';
47 case 'simons-macbook.lan.zhaw.ch'
48 dataPath = '/Users/simonmoser/Library/CloudStorage/OneDrive-ZHAW/MT/Measurements';
49 case 'clt-dsk-t-5217'
50 dataPath = 'C:\Users\moss\OneDrive - ZHAW\MT\Measurements';
51 otherwise
52 error('Unknown computer name: %s', computerName);
53end
54end
function getDataPath()