# Table of Contents

- Page ID
- 10942

A Brief Introduction to Engineering Computation with MATLAB is specifically designed for students with no programming experience. However, students are expected to be proficient in First Year Mathematics and Sciences and access to good reference books are highly recommended. Students are assumed to have a working knowledge of the Mac OS X or Microsoft Windows operating systems. The strategic goal of the course and book is to provide learners with an appreciation for the role computation plays in solving engineering problems. MATLAB specific skills that students are expected to be proficient at are: write scripts to solve engineering problems including interpolation, numerical integration and regression analysis, plot graphs to visualize, analyze and present numerical data, and publish reports.

### 4.1: What is MATLAB?

MATLAB stands for MATrix LABoratory (see wikipedia) and is a commercial software application written by The MathWorks, Inc. When you first use MATLAB, you can think of it as a glorified calculator allowing you to perform engineering calculations and plot data. However, MATLAB is more than an advanced scientific calculator, for example MATLAB's sophisticated numerical computation environment also allows us to analyze data, simulate engineering systems, document and share our code with others.### 5.1: Essentials

Learning a new skill, especially a computer program in this case, can be overwhelming. However, if we build on what we already know, the process can be handled rather effectively. In the preceding chapter we learned about MATLAB Graphical User Interface (GUI) and how to get help. Knowing the GUI, we will use basic math skills in MATLAB to solve linear equations and find roots of polynomials in this chapter.### 6.1: Plotting in MATLAB

A picture is worth a thousand words, particularly visual representation of data in engineering is very useful. MATLAB has powerful graphics tools and there is a very helpful section devoted to graphics in MATLAB Help: Graphics. Students are encouraged to study that section; what follows is a brief summary of the main plotting features.### 7.1: Writing Scripts to Solve Problems

MATLAB provides scripting and automation tools that can simplify repetitive computational tasks. For example, a series of commands executed in a MATLAB session to solve a problem can be saved in a script file called an m-file. An m-file can be executed from the command line by typing the name of the file or by pressing the run button in the built-in text editor tool bar.### 8.1: Interpolation

Linear interpolation is one of the most common techniques for estimating values between two given data points. For example, when using steam tables, we often have to carry out interpolations. With this technique, we assume that the function between the two points is linear. MATLAB has a built-in interpolation function.### 9.1: Computing the Area Under a Curve

This chapter essentially deals with the problem of computing the area under a curve. First, we will employ a basic approach and form trapezoids under a curve. From these trapezoids, we can calculate the total area under a given curve. This method can be tedious and is prone to errors, so in the second half of the chapter, we will utilize a built-in MATLAB function to carry out numerical integration.### 10.1: Regression Analysis

Suppose we calculate some variable of interest, y, as a function of some other variable x. We call y the dependent variable and x the independent variable. For example, consider the data set below, taken from a simple experiment involving a vehicle, its velocity versus time is tabulated. In this case, velocity is a function of time, thus velocity is the dependent variable and the time is the independent variable.### 11: Publishing with MATLAB

MATLAB includes an automatic report generator called publisher. The publisher publishes a script in several formats, including HTML, XML, MS Word and PowerPoint.