# Introduction to MATLAB

An important part of MA2501 Numerical Methods is the implementation of numerical methods as computer programs. For that we will use MATLAB, which is a computing environment and programming language designed specifically for numerical computations.

MATLAB is already installed at certain computer labs at NTNU. You may also install it on your own computer.

## Installing MATLAB

NTNU provides its students with a campus license. Please follow the instructions on here for how to download and install the software.

## Learning MATLAB

There are plenty of resources for learning MATLAB. The most accessible one is probably the product help of MATLAB itself. In the main MATLAB window, go to Help→Product Help. Under the "Getting started" header, you will find introduction videos and other resources.

The videos "Getting started with MATLAB", "Working in the Development Environment" and "Writing a MATLAB Program" gives an introduction to most of the basic uses of MATLAB.

The product help can also be found online, at http://www.mathworks.com/access/helpdesk/help/techdoc/matlab.shtml.

A (slightly dated) introduction in Norwegian can be found at http://wiki.math.ntnu.no/drift/stud/matlab. There are also several tutorials to be found at http://www.mathworks.com/academia/student_center/tutorials/launchpad.html.

Here is a basic introduction based on a lecture given by me for a similar course last semester .

## Functions

One of the biggest advantages of MATLAB is that it provides an extensive function library. Using these functions is an important part of writing functional and efficient MATLAB code. The help pages for the functions can be found either by searching for the function name in the help browser, or by typing either "help <function name>" of "doc <function name>", where <function name> is replaced by the name of the function, in the command window.

## Alternatives

There are also several MATLAB clones available for all those who prefer free and open source software. Examples are GNU Octave and Scilab. They offer the same basic functionality as MATLAB and have a very similar syntax, but do not contain as many libraries as MATLAB does. Also, the help pages of MATLAB are much more elaborate than those of its clones, which can be a problem for beginners.