Instructions, tutorials, FAQs and settings files for MATLAB
Last updated 2019-07-24 by Adam Lu
Where do I start?
- Connect to the server and open MATLAB via these instructions.
- Set up your MATLAB environment via these instructions.
- An interactive way to learn to very basics of MATLAB is the MATLAB Onramp course offered by MathWorks themselves (just create an account and you’ll be able to access it). An alternative is 6 short JHU MATLAB Tutorials located on the server (
/media/adamX/Settings_Matlab/Tutorials/JHU_Tutorials
). See Tutorials for more options. - Go through MathWorks’s own short tutorials: Getting Started With MATLAB
- Go through this free Coursera course on MATLAB basics
- Try writing your first function for the lab use this minimal template:
- In a MATLAB session, type
open function_template_minimal.m
- Save the file as your own function name
- Modify the fields to meet your function’s needs
- In a MATLAB session, type
- Read the Best Practices for Scientific Computing (2014) (also available under
/media/adamX/Settings_Linux/Tutorials
), then read the Blab guide for writing new MATLAB scripts and functions. - Now start coding! Here are the places to look if you need help with a function or if you don’t want to reinvent the wheel:
- Common MATLAB Functions.
- The file
function_template.m
(blabuva GitHub access required) - The official MATLAB documentation
- The
lookfor
command - The Sample MATLAB Code resources listed below, see especially Adam’s Functions
- The links under FAQ or Troubleshooting or Tutorials
- Google search: Type
Matlab <function name>
orMatlab <what you want a function to do>
Useful links
- See instructions here for how to access these links on the server.
- Tutorials
- Frequently Asked Questions
- Troubleshooting
Useful notes and templates
- Notes on setting up Matlab: Contains commonly used preference settings.
- MATLAB script template: Template for a new
.m
file. - Color map for the function rgb (available in
/home/Matlab/Downloaded_Functions
on both servers):
- Fundamental MATLAB classes:
- Installation notes
Sample Matlab Code
- The
/home/Matlab
directory on the servers contain functions that are shared across projects. To access a function from Matlab, add the directory containing the function to your search path. These functions are also synced on GitHub under respective repositories:- Adam’s Functions
- Alex’s Functions
- Ashley’s Functions
- Brian’s Functions
- Craig’s Functions
- Downloaded Functions
- Justin’s Functions
- Katie’s Functions
- Koji’s Functions
- Lise’s Functions
- Mark’s Functions
- Mira’s Functions
- Peter’s Functions
- Sami’s Functions
- ScottGodHater’s Functions
- GUIs
- Spike-Wave Detection GUI
- minEASE
- Navigate to the
~/Settings_Matlab/Sample_Matlab_Code
folder on the servers to access more resources:- Code and sample data for all figures in the book Analyzing Neural Time Series Data
- Code and sample data for all figures in the book MATLAB_for_Brain_and_Cognitive_Scientists
- Code Adam had from a long time ago for the book Numerical Methods in Biomedical Engineering
How can I update these files on the server?
-
Method 1: Update them directly from the locations:
/media/adamX/Settings_Matlab
or~/Settings_Matlab
(fishfish)/home/adam/Settings_Matlab
(chalkboard)
-
Method 2: Edit them here on GitHub then apply the following commands on the server
cd ~/Settings_Matlab
git_update