ENGR_141_Week_2-3_-_Algorithms,_Matrices,_Programs,_Functions_S08[1]

# ENGR_141_Week_2-3_-_Algorithms,_Matrices,_Programs,_Functions_S08[1]

This preview shows pages 1–18. Sign up to view the full content.

A LGORITHMS , M ATRICES , P ROGRAMS , & F UNCTIONS January 14, 2008

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
A LGORITHMS Simple sequences of instructions Can take many different forms oral directions written recipes pictorial assembly instructions video on how to install computer parts symbolic street signs or lights
O RAL A LGORITHMS ? Simon says… stand up Simon says… raise your right arm Raise your left arm

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
G RAPHICAL : L EGOS
G RAPHICAL : T RANSPORTATION

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
W RITTEN A LGORITHMS
H OW D O E NGINEERS D EVELOP A LGORITHMS ? Written: Documentation: developing a materials list, developing and documenting a sequential process “Pseudocode”: A combination of written directions and computer code (Eg. Count the number of students and measure their heights. Average height = sum of heights / total number of students) Writing code: MATLAB, C, C++, etc… Graphical: CAD drawings: Solid Edge, AutoCAD Flowcharting: Graphical representation of a sequential process

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
F LOWCHART FORMATTING Pictorial algorithms Rectangles represent actions / modules input, calculation, output Diamond-shapes are decisions Text in boxes can include “pseudocode”— similar to what you would type in Matlab Must include a box for the END
D IA http://www.dia-installer.de

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
M ICROSOFT W ORD 2007
E Enter race conditions Input the following values: Set Samstart = Sam’s head start [ft] Set Samspeed = Sam’s speed [ft/s] Set other race conditions Set Marystart = 0 [ft] Calculate race results Marytime = (length – Marystart) / Maryspeed Samtime = (length – Samstart) / Samspeed

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
E XAMPLE : R ACE R ESULTS ( CONTINUED ) We’ve just computed the time each runner finishes How can we tell who wins?
E ( End YES Print ‘Sam wins!’ Is Marytime > Samtime? YES Print ‘Mary wins!’ Print ‘It’s a TIE!’

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
M ATRIX A RITHMETIC
M ATLAB IS THE M AT RIX L AB ORATORY Matlab’s building block is the matrix Matrix terms and dimensions specified by row and column [m x n], as A(1,2) numbers are [1 x 1] matrices number of elements in the matrix is (m)(n) 6 5 4 3 2 1 6 5 4 3 2 1 12 11 10 9 8 7 6 5 4 3 2 1

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
V ECTOR PRODUCTS Vector product (or “dot” product) the sum of the product of corresponding terms the product of a vector with itself is its magnitude squared A = [x , y] [x , 0] [0 , y]
V ECTOR PRODUCT BA = ad + be + cf (a scalar) f e d c b a BA c b a B f e d A

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 45

ENGR_141_Week_2-3_-_Algorithms,_Matrices,_Programs,_Functions_S08[1]

This preview shows document pages 1 - 18. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online