Introduction & Overview
In the first two units, we’ll be going over some Matlab basics:
- how to start up the Matlab interpreter, + integrated development environment (IDE)
- some syntax, simple commands
- generally getting comfortable with the idea of turning your ideas into code
Materials
You can refer to a short matlab primer that will walk you through some of the basics.
Exercises
To make sure you are ready for the mini-project related to the neuroimaging analysis, I suggest you walk through the following sets of exercises on the Matlab command prompt. It’s important that you think about what should be happening before you hit the return key to execute the code. You could even put all the lines into a file in the Matlab editor window and write comments to go along:
- Doing basic maths on the command prompt
- Simple commands for getting the mean, std, etc.
- More simple commands and some practice making vectors and matrices that contain specific things.
- Scripts and functions - why they are useful, how they work.
- Plotting data - making simple plots.
- Loops, if/else, controlling flow - making simple plots.
- Test your knowledge - understand an existing piece of code and fix it up (debug + refactor)
- Application: loop over multiple plots - plot a family of curves (with nice colors)
- Application: nested loops to construct filenames - make strings / text that follows a certain pattern.