EGR 103/Spring 2016/Lab 3

From PrattWiki
Revision as of 20:50, 31 January 2016 by DukeEgr93 (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Typographical errors

None identified yet!

3.1 Introduction

The main purpose of this lab is to learn how to write programs and how to write functions and scripts that work together. The following is a companion piece to the lab handout itself. The sections in this guide will match those in the handout.

3.2 Resources

See main EGR 103 page for links to these

3.3 Getting Started

Same as it ever was.

3.4 Assignment

3.4.1 Chapra 2.11

Info on getting "filled-red" symbols is in Chapra 2.5.

3.4.2 Chapra 2.22

Pretty straightforward. Note that your function will only have three lines of code - the paradigm (the first line at the top of the function that defines the file as a function and names the outputs and inputs) and the two lines that calculate x and y, respectively. The script should to the rest. Putting too much in the function is grounds for losing points. Precious, precious points.

3.4.3 Chapra 3.10

The main concepts here are using logical masks to create piecewise functions, using different sets of points for mathematical analysis versus graphing, and determining and locating extrema.

3.4.4 Palm 4.44

The main concepts here are using the switch-case-otherwise structure when your code is to run certain lines of codes based on strings, using different point styles if you have five or more lines to graph in black and white, put using scripts and functions together.

3.4.5 Weather Data Analysis

The main concepts here are loading and parsing data, determining and locating extrema (using commands such as min, max, and find), printing out combinations of literal characters and formatted matrix values, and excising portions of matrices for use later.

General Concepts

This section is not in the lab report but rather has some items in it that span multiple problems in the lab.

Functions

See Chapra 3.1.2 and Palm 3.2 through page 123

Selective Structures

See MATLAB:Selective Structures, and note especially that if trees will only run if all the logical expression it is given is true. If you want to run when any of them is true, put the any() command with it. Also see Chapra 3.3.1 and Palm 4.4

Determining and Locating Extrema

See MATLAB:Plotting#Using_Different_Scales and MATLAB:Plotting_Surfaces#Finding_Minima_and_Maxima_in_2-D for some examples. Also see Palm Table 2.1-1.

Logical Masks

See MATLAB:Logical Masks.


Class Document Protection