Week 1
Week 1 – Introduction to MATLAB & Computational Thinking
Learning Outcomes By the end of this week, students will be able to:
- Install & navigate the MATLAB desktop, command window, and editor.
- Create and run scripts and functions and understand differences vs. command window.
- Create, manipulate and understand differences between scalars, vectors and matrices.
- Navigate the workspace.
- Perform basic operations and plotting in MATLAB.
- Use MATLAB’s help and documentation.
Suggested Readings
- Frain, MATLAB for Economics and Econometrics, Ch. 1 (Intro).
- MatlabCheatSheet.pdf - Reference for syntax and common commands.
- TutorialMatlab.pdf – Sections 1–3 (installation, workspace, variables).
In-Class Activities
- Tour of MATLAB interface: Command Window, Workspace, Editor.
- Create a script week1_intro.m that:
- generates and plot a simple production function $y=k^{\alpha}$
- Defines variables, vectors and matrices.
- Performs arithmetics.
- Produces simple plots.
- Use help, doc, and lookfor to find function descriptions.
- Save workspace and reload it.
- Save and run scripts.
- Save and load data.
Homework / Practice
- Create a script that calculates GDP deflator and inflation given nominal and real GDP and series.
- Compute real GDP growth.
- Explore plotting.
Files
- Slides Week 1 – Slides from lecture.
- week1_intro.m – Example script from lecture.
- challenge_starter.m – Starter file for in class challenge.
- wb_nominal_gdp.mat – data file for in class challenge.
- wb_gdp_rgdp.csv – data file for homework.
- data.csv – example of a csv data file.
- data.xlsx – example of a xlsx data file.