EGR 103/Fall 2014/Lab 3

From PrattWiki
Jump to navigation Jump to search

The following document is meant as an outline and recap of what was covered in lab.

Typographical Errors

  • The line "You will need to copy and paste your Singularity definition from the SingPlot.m file into your new code" on the top of page 6 directly under the equation should instead read: "You will need to copy and paste your Singularity definition from the TestSingularity.m file into your new code"

Specific Problems

Chapra 2.10

The main concepts here are functions, element-wise calculations, selective structures for validating inputs, and using a combination of point styles with solid lines to represent multiple data sets on the same graph. There is also a diary that is created to document how the code works.

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.

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.

Palm 4.19

The main concepts here are validating inputs correctly, generating arrays, running code based on the number of inputs, and using logical masks.

Palm 4.20

The main concepts here are writing piecewise functions correctly and using logical masks.

General Concepts

Functions

See Chapra 3.1.2and 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 Finding Minima and Maxima in 2-D for some examples. Also see Palm Table 2.1-1.

Logical Masks

See MATLAB:Logical Masks.