{"id":21765676,"url":"https://github.com/schluppeck/learningmatlab","last_synced_at":"2025-10-07T00:15:43.815Z","repository":{"id":91667009,"uuid":"41384661","full_name":"schluppeck/learningMatlab","owner":"schluppeck","description":"Introduction to Matlab Programming","archived":false,"fork":false,"pushed_at":"2022-12-26T21:06:23.000Z","size":94481,"stargazers_count":6,"open_issues_count":0,"forks_count":6,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-13T15:11:44.021Z","etag":null,"topics":["introduction","learning","material","matlab","tutorial"],"latest_commit_sha":null,"homepage":"http://schluppeck.github.io/learningMatlab/","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/schluppeck.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2015-08-25T19:51:50.000Z","updated_at":"2024-01-19T21:21:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"567298d7-0292-492c-abf2-c93dcb28f293","html_url":"https://github.com/schluppeck/learningMatlab","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/schluppeck/learningMatlab","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schluppeck%2FlearningMatlab","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schluppeck%2FlearningMatlab/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schluppeck%2FlearningMatlab/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schluppeck%2FlearningMatlab/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/schluppeck","download_url":"https://codeload.github.com/schluppeck/learningMatlab/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schluppeck%2FlearningMatlab/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275179596,"owners_count":25419063,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-14T02:00:10.474Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["introduction","learning","material","matlab","tutorial"],"created_at":"2024-11-26T13:13:23.631Z","updated_at":"2025-10-07T00:15:38.772Z","avatar_url":"https://github.com/schluppeck.png","language":"HTML","readme":"# learningMatlab\n\n\n\u003cimg src=\"learningMatlab-splash.png\" width=\"80%\"\u003e\n\n[![View learningMatlab on File Exchange](https://www.mathworks.com/matlabcentral/images/matlab-file-exchange.svg)](https://uk.mathworks.com/matlabcentral/fileexchange/108189-learningmatlab)\n\n## What's this?\n\nMaterials and exercises from the *Introduction to Matlab Programming* course which forms part of our [*MSc Cognitive Neuroscience*](https://www.nottingham.ac.uk/pgstudy/courses/psychology/cognitive-neuroscience-msc.aspx).\n\nFor **viewing** the materials use: \u003ca href=\"https://schluppeck.github.io/learningMatlab/\"\u003e\nhttps://schluppeck.github.io/learningMatlab/\u003c/a\u003e\n\nFor inspecting the code and details: \u003ca href=\"https://github.com/schluppeck/learningMatlab\"\u003ehttps://github.com/schluppeck/learningMatlab\u003c/a\u003e\n\n## Preliminaries\n\n- :ballot_box_with_check:  **Create a (free) account at [The Mathworks](https://uk.mathworks.com/mwaccount/register).** Using your university e-mail address will allow you to use the university's academic license. As an added bonus, you'll be able to install Matlab on your own computer / laptop (MacOS, Windows, or Linux)\n\n- There is a self-directed **Matlab onramp** course that we will refer to during the course. This includes some short videos and interactive lessons, which we will use to [flip the classroom](https://en.wikipedia.org/wiki/Flipped_classroom).\n\n- :ballot_box_with_check: **We'll ask you to complete** [this onramp course](https://matlabacademy.mathworks.com/R2019a/portal.html?course=gettingstarted). The sections should't take too long complete and there are lots of hints to guide you through the material at your own pace.\n\u003cimg src=\"onramp.png\" width=\"50%\" alt=\"screenshot of matlab onramp\" caption=\"Screenshot of onramp course\"\u003e\n\n## Get me started on the material here!\n\n1. The first place to check out is the [aToZ-intro](aToZ-intro). Run through these exercises on the lab machines (or on your own copy of Matlab).\n\n2. Find PDF materials in one place in the [matlab primer [PDF]](aToZ-intro/c84nim-exercises.pdf)\n\n3. Lecture slides for sessions 1-4:\n  - \u003ca href=\"https://schluppeck.github.io/learningMatlab/slides/00-introduction.html\" target=\"_blank\"\u003e00-introduction.html\u003c/a\u003e\n  - \u003ca href=\"https://schluppeck.github.io/learningMatlab/slides/01-getting-started.html\" target=\"_blank\"\u003e01-getting-started.html\u003c/a\u003e\n  - \u003ca href=\"https://schluppeck.github.io/learningMatlab/slides/02-more-vectors+matrices.html\" target=\"_blank\"\u003e02-more-vectors+matrices.html\u003c/a\u003e\n  - \u003ca href=\"https://schluppeck.github.io/learningMatlab/slides/03-indexing-looping-branching.html\" target=\"_blank\"\u003e03-indexing-looping-branching.html\u003c/a\u003e\n\n\n## Who is it for? What are the aims?\n\nThe main aims is to help the students to get to grips with the basic ideas of computer programming and, more specifically, the use of Matlab.  The course materials started out for a graduate course for psychologists and neuroscientists.\n\nThe exercises draw on material that students on our *MSc* courses encounter in other modules. It's therefore a great opportunity for hands-on revision of some important concepts such as\n\n- time series data\n- images in 2d and 3d\n- linear/non-linear regression\n\nThe syllabus is for a 10 week (10 x 2h) lab class, assuming very little computer experience (or maths) at the start.\n\nFeel free to use the code. If you feel it's particularly helpful to you... I accept donations in the form of freshly roasted coffee beans.\n\nThe course has two chunks. (Schluppeck has been tinkering with the course more recently and we've also done [a different project around stimulus presentation](README_B.md).\n\n1. an introduction to the basic ideas (variables, functions, control flow) - running over **the first 4 weeks**. Check out the material in the **aToZ-intro** folder and the associated [readme file here.](aToZ-intro)\n\n2. **Timetable A**. A project, building some basic utilities / functions for looking at neuroimaging data and performing linear regression (GLM), **6 weeks**. Details on the imaging-related units is outlined in [here.](imaging-01)\n\n\n## Timetable A (around a looking at images, 3d data, ...)\n\n| Week | Unit                     | Topic                                                     |\n|:-----|:-------------------------|:----------------------------------------------------------|\n| 1    | [aToZ-intro](aToZ-intro) | What is Matlab, the environment, variables, indexing, ... |\n| 2    | [aToZ-intro](aToZ-intro) | Types of data: numeric, logical, text, etc.               |\n| 3    | [aToZ-intro](aToZ-intro) | Indexing, looping, branching, functions, ...              |\n| 4    | [aToZ-intro](aToZ-intro) | Understanding someone else's code                         |\n| 5a   | [imaging-00](imaging-00) | What are images? How to display them                      |\n| 6a   | [imaging-01](imaging-01) | Building / fixing up a simple image viewer                |\n| 7a   | [imaging-02](imaging-02) | A function that constructs a simple design matrix         |\n| 8a   | [imaging-03](imaging-03) | Hands-on linear regression (using a sample timecourse)    |\n| 9a   | [imaging-04](imaging-04) | Doing regression *stats*, displaying                      |\n\n\n\n## How to get these materials\n\nAssuming you are on a Mac: open up a ``Terminal`` (double-click /Applications/Utilities/Terminal). Then do the following:\n\n```shell\n# if you don't already have one: create a ``matlab`` directory in your home space (``~``), then change directory to it:\ncd ~\nmkdir matlab\ncd matlab\n# get MGL (for the behavioral project)\ngit clone https://github.com/justingardner/mgl.git\n# get these tutorials\ngit clone https://github.com/schluppeck/learningMatlab.git\n```\n\nYou'll need to add both these subfolders to your path; then you should be good to go. A convenient way to do this is to run this or add this to your ``startup.m`` file:\n\n```matlab\naddpath(genpath('~/matlab/'))\n```\n\n## Grabbing updates\n\nTo make sure you have any updates to this material, open a Terminal, change directory to the ``learningMatlab`` folder and issue ``git pull``. This will sync you the material on github. Alternatively, download the zip archive of the repository.\n\n## Notes\n\n- [getting started with examples](https://uk.mathworks.com/help/matlab/examples.html?s_tid=acb_mlex) - a collection of beginner friendly examples in the Matlab documentation.\n- The sections should't take too long complete.\n\n- getting a certificate of your Matlab ONRAMP course progress / completion\"\n\u003cimg src=\"onramp-progress.png\" width=\"60%\" alt=\"screenshot of matlab onramp\" caption=\"Screenshot of onramp course\"\u003e\n\n## Colophon\n\n- In the 2015/2016 iteration of the course, I modified the hands-on project for building a simple behavioural task to use **mgl** (https://github.com/justingardner/mgl). Although this requires teaching a couple more details on how stimuli are being displayed by the OpenGL machinery and it's not pure Matlab, it's (a) more realistic and (b) makes displaying different kinds of stimuli, obtaining keyboard responses, etc. much more fun and doable.\n\n- In the 2017 iteration, students built a psychophysical experiment (slightly different task, but similar in spirit)\n\n- In 2018, the assignment for the course was complete and extend an analysis script for fMRI data by writing some helper functions. Students were also using ``publish()`` to explore documentation and mixing code with report writing.\n\n\u003cscript data-name=\"BMC-Widget\" src=\"https://cdnjs.buymeacoffee.com/1.0.0/widget.prod.min.js\" data-id=\"schluppeck\" data-description=\"Support me on Buy me a coffee!\" data-message=\"Thank you for visiting. You can now buy me a coffee!\" data-color=\"#ff813f\" data-position=\"Right\" data-x_margin=\"18\" data-y_margin=\"18\"\u003e\u003c/script\u003e\n\n\n## Contact\n\n\u003ca href=\"https://twitter.com/schluppeck\"\u003ehttps://twitter.com/schluppeck\u003c/a\u003e\n\n\n","funding_links":["https://cdnjs.buymeacoffee.com/1.0.0/widget.prod.min.js"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fschluppeck%2Flearningmatlab","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fschluppeck%2Flearningmatlab","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fschluppeck%2Flearningmatlab/lists"}