# Matlab Manual

Topics: MATLAB, User interface, Mathematics Pages: 44 (11755 words) Published: August 17, 2013
AP Induction Week Course
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

TASK There is a lab task to complete. TIP There is a handy tip to help you with MATLAB. Star There is a description of good programming practice. If you follow these tried and true conventions you will be a programming star! Stop There is a “roadblock to understanding”. Make sure you ask a tutor for clarification if you don’t understand what MATLAB is doing.

2

INTRODUCTION TO MATLAB
MATLAB (MATrix LABoratory) is an interactive software system for numerical computations and graphics. As the name suggests, MATLAB is especially designed for matrix computations: solving systems of linear equations, performing matrix transformations, factoring matrices, and so forth. In addition, it has a variety of graphical capabilities, and can be extended through programs written in its own programming language. MATLAB is supported on Unix, Macintosh, and Windows environments. A student version of MATLAB for Macintosh or Windows may be purchased from the Science Student Resource Centre, which you can install on your own computer.

    It simplifies the analysis of mathematical models It frees you from coding in lower-level languages (saves a lot of time - with some computational speed penalties) Provides an extensible programming/visualization...