Skip to content
Alexander Refsum Jensenius edited this page Dec 21, 2020 · 2 revisions

Before we get started with MGT, we will familiarize ourselves just a little bit in Matlab.

Your first Matlab scripting

Matlab is a scripting language, in which you type a message in the command window and press Return. Try to type in the following lines:

1+1

One of the strengths of Matlab is to be able to work with symbols. Try this:

a=1
b=2
c=a+b

You can also try combinations of symbols and numbers:

(a+1)*(b+2)

The semicolon

The semicolon is important in Matlab. Look at the difference between this:

a+b;

and this message:

a+b

Plotting

One of the big strengths of Matlab is all the plotting functions. Try this example:

xlabel('x = 0:2\pi')
ylabel('Sine of x')
title('Plot of the Sine Function')

That is about what you need to know to get started with MGT.

Escape

If you ever get stuck in Matlab, you can press Ctrl+C to interrupt the running process.

Toolboxes

One of the strengths of Matlab is that there are lots of toolboxes available. The MGT is one such toolbox, and it builds on some other toolboxes: matlabPyrTools, MoCap Toolbox and MIRtoolbox. For these toolboxes to work properly, we need to add them to the path of Matlab. That is a location for extra stuff that we want to add. This should typically be a folder in your home folder.

Adding path

Under the "Home" section, click "set path". Click the "Add Folder" button and choose the "source-code" folder and finally click "save".

It is also possible to set the path via the command line in Matlab, using something like:

addpath('~/Documents/Toolboxes');

When you are done, you should be able to run the following command:

Clone this wiki locally