Skip to content

Commit 3f43dae

Browse files
committed
mention on to use mpm in readme
1 parent 5eb29f8 commit 3f43dae

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,46 @@ We keep the McCabe complexity as reported by the [check_my_code function](https:
3131

3232
## How to install
3333

34+
### Use the matlab package manager
3435

36+
This repository can be added as a dependencies by listing it in a [mpm-requirements.txt file](.mpm-requirements.txt)
37+
as follows:
38+
39+
```
40+
CPP_PTB -u https://github.com/cpp-lln-lab/CPP_PTB.git
41+
```
42+
43+
You can then use the [matlab package manager](https://github.com/mobeets/mpm), to simply download the appropriate version of those dependencies and add them to your path by running a `getDependencies` function like the one below where you just need to replace `YOUR_EXPERIMENT_NAME` by the name of your experiment.
44+
45+
46+
```matlab
47+
function getDependencies(action)
48+
% Will install on your computer the matlab dependencies specified in the mpm-requirements.txt
49+
% and add them to the matlab path. The path is never saved so you need to run getDependencies() when
50+
% you start matlab.
51+
%
52+
% getDependencies('update') will force the update and overwrite previous version of the dependencies.
53+
%
54+
% getDependencies() If you only already have the appropriate version but just want to add them to the matlab path.
55+
56+
experimentName = YOUR_EXPERIMENT_NAME;
57+
58+
if nargin<1
59+
action = '';
60+
end
61+
62+
switch action
63+
case 'update'
64+
% install dependencies
65+
mpm install -i mpm-requirements.txt -f -c YOUR_EXPERIMENT_NAME
66+
end
67+
68+
% adds them to the path
69+
mpm_folder = fileparts(which('mpm'));
70+
addpath(genpath(fullfile(mpm_folder, 'mpm-packages', 'mpm-collections', experimentName)));
71+
72+
end
73+
```
3574

3675

3776
## Structure and function details

0 commit comments

Comments
 (0)