Introduction to Engineering Computation
Laboratory Manual
MATLAB programming
Department of Engineering Science
MATLAB Laboratory Manual Contents
Laboratory 1: An introduction to MATLAB ............................................................................................ 2 Laboratory 2: Debugging, Functions and Problem Solving ............................................................22 Laboratory 3: Logical Operators, Conditional Statements and Loops ........................................32 Laboratory 4: Graphics and Image Processing ...................................................................................46 Laboratory 5: Strings and Files ................................................................................................................52 Laboratory 6: Linear equations and differential equations ..........................................................57
Laboratory 1: An introduction to MATLAB
GETTING STARTED
Your Tutor will show you how to login to the Network. Most of the applications you will use reside on File Servers rather than on the local hard drive of your computer. You have also been allocated an ec (Electronic Campus) home directory (H drive), in which you can save your work. If your computer is switched off (you can tell this by the absence of a light on the front of the computer) you should press the Power on the computer’s front panel. Do not switch the monitor on or off at any time! If the light is already on, you can simply restart the login sequence by holding down the Ctrl and the Alt keys and pressing the Delete key.
GENERAL LAB DIRECTIONS
You should work your way through the tutorials reading everything. Interaction with the computer takes place throughout the lab. The sections are not stand-alone so you must work through them in order. There are a number of assignment tasks throughout the Lab that will be checked by your tutor when you have completed the whole