Online MATLAB Course for Students of Economics

matlab.jpg

Welcome!

Welcome to this short online course introducing the programming language MATLAB to students of economics. By completing the exercises in this course you will be introduced to all the main aspects of MATLAB. The course additionally contains some examples where MATLAB is used to solve well-known problems in micro, macro and econometrics (based on material from the second year courses). 

We believe that programming is an essential skill for modern economists. Even for models which we can solve analytically it is useful to look at numerical solutions to improve our understanding. Additionally, there are lots and lots of models which can not be solved analytically. Here numerical solutions on a computer is the only way forward. Wrt. to master level courses, MATLAB is e.g. used in Advanced Microeconometrics and Dynamic Programming.

This is a pilot version of the course. We will therefore be very happy if you would answer this short survey (Links to an external site.)Links to an external site. after you have completed a couple of exercises or even the full course.

If you develop code of your own you wish to share with other students, please send them to us. Then we can include it as additional case studies.

Getting started

The first things you need to do are:

  1. Install MATLAB 2017b following the instructions here: Installing MATLAB.
  2. Opening up MATLAB and read through this brief introduction to the interface: The first time you open MATLAB.

Watch this video on how to get started:

Details:

Open MATLAB and write the following in the command window

   unzip('https://absalon.ku.dk/files/1143371/download?download_frd=1')

This creates a folder called MATLAB_Online_Course_EconStud with all the relevant files. Double-click on the folder in the current folder window. 

Alternatively: Download Download Download and unzip the course package yourself, and locate the folder within MATLAB. 

To solve exercise "1" simply open the file "exercise_1_data_types.mlx" and follow the instructions. Some exercises also contain some additional material related to the topic.

Cases: The course also contains a micro, econometrics and a macro case, where we show how MATLAB can be used in practice with models you know.

Appendix: The course also contains an appendix with some tips and tricks for efficient programming, see good_programming.mlx.

Exercises

The exercises currently contained in the course package are:

# Name Description
1 Data Types You will learn how to use structs, arrays and cells.
2 If/else statements and loops You will learn how to use if/elseif/else statements, for and while loops, and logical indexing.
3 Functions You will learn how to use functions.
4 Printing You will learn how to print results to screen.
5 Figures You will learn how to create figures and saving them to disc.
6 Save and load You will learn how to load and save data in MATAB and to and from Excel.
7 Optimization You will learn how to numerically solve equations and solve optimization problems.
8 Random numbers You will learn how to draw random numbers.
Case A: Micro You will see how to solve a standard consumer problem (known from Micro I).
Case B: Econometrics You will see how to estimate regressions using OLS or maximum likelihood (known from Econometrics I).
Case C: Macro You will see how to solve and simulate from a AS-AD model and find the optimal stabilisation policy (known from Macro II).
Appendix: Good Programming This appendix contains some tips and tricks for efficient programming.

Contact

For questions or comments please contact us:

Please help them by answering this short survey (Links to an external site.)Links to an external site..