What is covered by this tutorial?

This introductory course is intended to provide a practical introduction to working with the program Matlab® by The MathWorks, particularly focussing on aspects being relevant for data processing in psychological research. Matlab is often used in experiments applying psychophysical methods such as electro-encephalography (EEG), eye tracking, or registration of galvanic skin response (GSR). Put more generally, Matlab is very useful for the evaluation of large data sets that are often acquired automatically, as it is the case in logfile analysis or internet experiments as well.

Why Matlab?

Matlab is a programming language often used in psychological research. It is especially suitable for data analysis but can be applied for programming computer-controlled experiments as well. In contrast to other programming languages, a particular advantage of Matlab is that is works as an «interpreter»: commands that are typed in are processed immediately without having to compile the program beforehand; skipping this step leads to a faster development cycle. In that way, you can try out the syntax of a command in an uncomplicated manner and see whether they lead to the intended effect. Then the tested commands can be pasted into the final program file.

The scope of this course

Matlab is a very comprehensive software package, and most users only use a small part of it. Thanks to a very good integrated documentation and help system, it is relatively easy to learn additional commands once one has understood the basics.
In this sense, this course is confined to the basic functionality of Matlab, i.e. matrix-based data processing and visualisation.
The functionality of SimuLink (simulation program) will not be covered. Likewise, the functions of specialised tool boxes (neural network toolbox, wavelet toolbox etc.) cannot be covered; these are only rarely put to use in the course of psychological research. Rather, a solid basis should be established, starting from which it should be possible to autonomously acquire further knowledge and skills if needed.

Overview over the contents

  • What can Matlab be used for?
  • How to work with the user interface
  • The basics: numbers, data types, operators, functions, etc.
  • Programming of scripts and functions
  • Program control structures: looping and branching
  • Reading data from file, processing them, and writing them back to file
  • Interaction with the user
  • Statistical functions
  • Graphics functions

All lesson contents can be practiced and applied in short practice assignments. In addition, self-test questions are available in order to assist the learning process by evaluating what you have learned.
Moreover, in the course of this tutorial, you will be able to develop a somewhat larger program project that is typical for applications in psychological research: importing and aggregation of data from several data sets, doing calculations with these data, saving the results in a format suitable for further processing (e.g. with SPSS or Statistica), and visualisation of the results.


This learning resource was realised as a sub-project of the edulap project.

Roman von Wartburg, Ph.D.
Contents, didactical concept, implementation, translation, start page animation

Sarah Steinbacher, dipl. designer FH
Graphic design

Radka Wittmer, M.Ed.
Didactics counsel

Stephanie Schütze, Dipl. psych.
Usability evaluation

Joël Fisler
Implementation of graphic design


This project was supported by several institutions:


«Introduction to Matlab» by Roman von Wartburg/Distance Learning University Foundation Switzerland is licensed under a Creative Commons «Attribution/Non-Commercial/Share Alike» 2.5 Switzerland License. That is, you are free to copy, distribute, transmit, and adapt the work. The conditions are: You must attribute the work by naming the original author; you may not use it for commercial purposes; if you alter, transform, or build upon it, you may distribute the resulting work only under the same or similar license to this one.
Further information

Implementation and distribution

This course was implemented with eLML. The complete eLML source code is contained in the content packages that can be downloaded below:

ZIP archive of the HTML version
If you do not have permanent web access, you can unpack this archive to your hard disk and open locally with your web browser.

Content package in IMS/CP format
This version is intended for uploading to a learning management system such as OLAT, Moodle, or ILIAS.