This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
analysis:nsb2017:week1 [2018/06/30 14:46] mvdm [Cloning the module codebase] |
analysis:nsb2017:week1 [2018/07/01 22:09] mvdm [Configuring MATLAB to use the code from GitHub] |
||
---|---|---|---|
Line 89: | Line 89: | ||
=== Configuring MATLAB to use the code from GitHub === | === Configuring MATLAB to use the code from GitHub === | ||
- | Now, we need to tell MATLAB where to find all this code we have just obtained. Open MATLAB and [[http://www.mathworks.com/help/matlab/matlab_env/create-matlab-shortcuts-to-rerun-commands.html | create a shortcut]] titled something like "Neural Data Analysis". The code for the shortcut should be | + | Now, we need to tell MATLAB where to find all this code we have just obtained. Open MATLAB and [[http://www.mathworks.com/help/matlab/matlab_env/create-matlab-shortcuts-to-rerun-commands.html | create a shortcut]] (2017b and earlier) or a [[https://www.mathworks.com/help/matlab/matlab_env/create-matlab-favorites-to-rerun-commands.html?searchHighlight=Favorite%20Commands&s_tid=doc_srchtitle | Favorite]] (2018a+) titled something like "Neural Data Analysis". The code for the shortcut should be |
<code matlab> | <code matlab> | ||
restoredefaultpath; clear classes; % start with a clean slate | restoredefaultpath; clear classes; % start with a clean slate | ||
- | cd('D:\My_Documents\GitHub\nsb2017\code-matlab\shared'); % or, wherever your code is located -- NOTE \shared subfolder! | + | cd('D:\My_Documents\GitHub\nsb2018\code-matlab\shared'); % or, wherever your code is located -- NOTE \shared subfolder! |
p = genpath(pwd); % create list of all folders from here | p = genpath(pwd); % create list of all folders from here | ||
addpath(p); | addpath(p); | ||
Line 106: | Line 106: | ||
This ensures that whenever you click this button, you have a clean **path** (the set of folders, other than the current working directory, whose contents MATLAB can access) of only the MATLAB default plus your local versions of the two %%GitHub%% repositories. | This ensures that whenever you click this button, you have a clean **path** (the set of folders, other than the current working directory, whose contents MATLAB can access) of only the MATLAB default plus your local versions of the two %%GitHub%% repositories. | ||
- | :!: When setting your path in MATLAB to add the ''shared'' folder only and //not// a parent folder such as ''nsb2017''. Adding the entire ''nsb2017'' folder will result in an error when you try to run the LoadCSC command later in the module! | + | :!: When setting your path in MATLAB to add the ''shared'' folder only and //not// a parent folder such as ''nsb2018''. Adding the entire ''nsb2018'' folder will result in an error when you try to run the LoadCSC command later in the module! |
Optional: if you don't like the ''.git'' folders in your path, you can get clever with [[http://www.mathworks.com/help/matlab/matlab_prog/regular-expressions.html|regular expressions]] to remove these: | Optional: if you don't like the ''.git'' folders in your path, you can get clever with [[http://www.mathworks.com/help/matlab/matlab_prog/regular-expressions.html|regular expressions]] to remove these: |