Introduction to Matlab programming

Spring 2015 - Thu. 1000—1130 AM  Lab: 4/111
MIN---, 5 credits
Department of Information Technologies

Course Objectives

The primary objective of this course is to introduce students to the fundamental concepts and techniques of programming in Matlab and creating basic level simulations in Simulink


Three assignments will be given during the course. The first two of them will account for 25-25% while the last one will account for 50% of the grade of the students. Assignments 1 and 2 are short presentations about a selected topics related to the course. Assignment 3 is a programming task. All assignments are due at the start of class on the due date. Assignments are individual work unless otherwise specified.

Recommended readings

  • A short introduction to Matlab programming [pdf]
  • Amos Gilat: Matlab: An introduction with applications, Wiley, 2004, ISBN: 978-0-471-69420-5

Class Schedule (tentative)


Week 1: Introduction to Matlab. Basic commands, using the environment. Editing figure properties by using visual tools. Plotting. Vectors and matrices.
Week 2: Customizing plots programmatically and by the help of visual tools. Creating scripts and functions. Executing functions at once and step-by-step. Flow control. If –else and switch-case statements. Implementing an algorithm given in form of a flow chart. Displaying different values in Command Window and in message boxes. Saving and reusing figures. Creating HTML documentation.
Week 3: Flow control. While loop, for loop. Numerical integration using trapezoidal approximation. Integration by symbolic toolbox. Formatted output. fprintf.  Functions of two variables. Three dimensional plots.
Week 4: Assigment 1 (in the first part of the class)
Three dimensional plots (mesh, surf, contour, meshc). Using subplots. Plotting a sphere, a cylinder, a cone, a set of balloons, and a vase. Drawing polyhedrons (patch). Creating an animation: throwing under the angle &alpha with a release velocity v. [HTML]
Week 5: Creating a graphical user interface. Using guide to build GUI application. Structures. Callback functions. Text and numerical data representation. Using button groups for mutually exclusive selection. Using popup menus. Plotting on an axes component. Ex. 1. Creating GUI with GUIDE Matlab demo. Ex. 2. Creating a GUI for the calculation of the roots of a quadratic equation. [Source code]
Week 6: Assigment 2 (in the first part of the class)
Creating a GUI for the throwing program. Assignment for individual work: create a program with GUI that converts the values from Celsius to Fahrenheit and vice versa. Creating pushbuttons containing arrows. [Source code]
Week 7: Design of a cylindrical tank with a hemispheric part. Goal: minimum cost. Creating a GUI for the calculations. Working with experimental data. Reliability calculations I. [Source code]
Week 8: Solving linear equations. Linear Regression [HTML]. Polynomial Regression [HTML]. Linear interpolation [HTML]. Reliability calculations II. [HTML] [Source code]
Week 9: Create a GUI program for the simulation of the motion of the two parts of a robot arm [Executable version][Source code].
Week 10: Simulink
Week 11: Assigment 3
Week 12: Simulink