# [ENGR 101] - Midterm Exam Guide - Comprehensive Notes for the exam (111 pages long!)

106 views111 pages
7 Feb 2017
School
Department
Course

U of M
ENGR 101
MIDTERM EXAM
STUDY GUIDE
Unlock document

This preview shows pages 1-3 of the document.
Unlock all 111 pages and 3 million more documents.

Unlock document

This preview shows pages 1-3 of the document.
Unlock all 111 pages and 3 million more documents.

Writing Functions in MATLAB
suppose we want to write a function in MATLAB that takes as input the initial height, x0,
and velocity, v0, of a ball at time zero along with a duration, tmax, to simulate the ball’s
trajectory
the function plots the height and velocity of the ball over the duration of the simulation
v = g*t+v0
h = g*t^2+v0*t+h0
Program design can easily be done by making use of flow charts
Parts of a flow chart-
terminal positions
rectangular oval
start/end
do something
rectangles or squares
specify instructions that create data
selection
decision box
create both selection and iteration
has a question in it
yes or no
get input and/or send output
Implementing Code-
comment the code
include a glossary of your identifiers
variables that have non-standard names
comment individual segments of code
make time array
calculate velocity and position
numel - function that returns number of elements in an array
find more resources at oneclass.com
find more resources at oneclass.com
Unlock document

This preview shows pages 1-3 of the document.
Unlock all 111 pages and 3 million more documents.

USING ITERATION
A BETTER WAY
uses the equations with vectors
will output a vector of velocities
Plotting
find more resources at oneclass.com
find more resources at oneclass.com
Unlock document

This preview shows pages 1-3 of the document.
Unlock all 111 pages and 3 million more documents.