# Introduction to Matlab for Northrup Grumman

## Matthias K. Gobbert - Fall 1998

See there for updates on the course.

## Basic Information

• Instructor: Matthias K. Gobbert
Math/Psyc 416, (410) 455-2404, gobbert@math.umbc.edu
• Class times: Monday 05:30-07:30p.m., ECS 104A
• Prerequisite: Basic familiarity with concepts of high-level programming

## Available Written Introduction to Matlab

Arguably the best introduction to Matlab 5 is contained in the volume ``Getting Started with MATLAB'' from The MathWorks, Inc.; the volume is available in the department computer room MP 412 in the blue folder. Following this manual, introductions to more topics are contained in the ``Using MATLAB'' and the ``Using MATLAB Graphics'' manuals also available there.

## Basic Matlab Session:

In the UNIX-environment, start Matlab using the command ``matlab;'' this should result in a screen like this:
```                                < M A T L A B (R) >
(c) Copyright 1984-98 The MathWorks, Inc.
Version 5.2.1.1420
Apr 30 1998

To get started, type one of these: helpwin, helpdesk, or demo.
For product information, type tour or visit www.mathworks.com.

>>
```
Here, ``>>'' is the Matlab prompt awaiting command input from the user. To quit Matlab, enter the command ``exit'' or ``quit,'' and the UNIX-prompt will return.

The programs listed below are Matlab functions, often referred to as m-files. They accomplish some simple task as documented in the text. Download the files to your account using, say, Netscape using, for instance, the ``File'' and in there the ``Save As''-functionality. Then call them from Matlab.

## Solutions to some of the homework problems:

• Homework 2: Reference data for problem 1: dataref.m.
• Homework 3:
• Simpson method: Call the function driver from Matlab (without any arguments), which calls driverf, which in turn calls simpson. My example function is f16b.
• Contour plot: The function is in fxyexp. First, I call drivercontour without any arguments to obtain a default contour plot with rather inconvenient labels. It outputs the minimum and maximum data values. Based on this, I call
```        >> drivercontour ([-0.2 : 0.025 : 0.2]);
```
to obtain a contour plot with labels that have at most 3 decimal digits.
• Homework 6:
• Data file memb.dat from a finite element package