clear,clc
% Project 1
% Creates upper limit for the height
h_up = 47000;
h = 0:1000:h_up;
% Makes the height of each atmosphere
h_topo = 11000;
h_strat = 25000;
% for loop from i to h_up
for i = 1:length(h);
% Places values to the constants at Sea Level
T

Hi Folks, Here is a hint for the binary conversion code: 1) Many of you will try using a variable like, INTEGER (kind=8) : base2 to store the base-2 equivalent (all 0's and 1's) of a base-10 number in. That does not work, because the computer treats

clear,clc
% Enter values for dimensions
% Change cm to in if needed
L = input('enter the length of the base')
Ld = input('Is that i or c?','s')
if Ld = ' c'
L = L / 2.54
end
W = input('enter the width of the base')
Wd = input('Is that i or c?','s')
if Wd

clear,clc
% Input speeds of aircraft and sound
SpAc = input('What is the speed of the aircraft in m/s: ')
SpSo = input('What is the speed of sound in m/s: ')
% Calculate Mach number
Mach = SpAc / SpSo
% Determin sonic speed
if Mach < 1
fprintf('The aircra

clear,clc
% User inputs Reynolds number of a flow
Re = input('What is Reynold number in this flow?')
% Determine the region of the flow and outputs it
if Re <= 2300
fprintf('The flow falls in the Laminar Region')
elseif Re <= 4000
fprintf('The flow falls

clear, clc
% Inputs the grade values for the two different grades
g1 = [99 88 95];
g2 = [99 70 77];
% Calculates and prints mean and median of the two grade possibilities
fprintf('
mean
median\n')
fprintf('Grade 1: %8.2f %8.2f\n', mean(g1),median(g1)
fpri

Aer E 161
Fall 2015
Homework and Exercises 4
No specific exercises this week since Test 1 will be taken during the lab time.
Homework 4 (due Wednesday, September 30, in lecture at 9am)
Problem description:
One way to calculate the square root of the numbe

Aer E 161
Fall 2015
Homework and Exercises 8
Exercises (to be performed during the lab on Friday, November 6)
14.37, 38, 43, 44, 45, 47
Homework 8 (due Wednesday, November 11, in lecture at 9am)
Problems:
1. Given the following 2 x 2 system of equations:

Aer E 161
Fall 2015
Homework and Exercises 3
Exercises (to be performed during the lab on Friday, September 18)
5.1, 5, 7, 9, 19, 23, 28, 29, 34, 36
Homework 3 (due Wednesday, September 23, in lecture at 9am)
Problem description:
Statistical analysis is w

Aer E 161
Fall 2015
Homework and Exercises 7
Exercises (to be performed during the lab on Friday, October 23)
14.26, 27, 28, 30, 31, 34
Homework 7 (due Wednesday, October 28, in lecture at 9am)
Problem description:
Write the following sorting functions:
1

Aer E 161
Fall 2015
Homework and Exercises 2
Exercises (to be performed during the lab on Friday, September 11)
4.5, 8, 17, 26, 30, 31
Homework 2 (due Wednesday, September 16, in lecture at 9am)
Problem description:
Consider a quadratic equation of the fo

Aer E 161
Fall 2015
Homework and Exercises 5
Exercises (to be performed during the lab on Friday, October 9)
6.3, 32, 35; 7.3, 16, 33, 37; 8.1, 13, 18, 24, 25; 9.2, 7, 9, 19, 21, 25, 28
Homework 5 (due Wednesday, October 14, in lecture at 9am)
Problem des

Aer E 161
Fall 2015
Homework and Exercises 1
Exercises (to be performed during the lab on Friday, September 4)
Last lab: 1.12, 14, 16, 20, 24, 29; and 2.1, 2, 3, 8, 11.
This lab: 2.7, 15, 16, 20, 26, 28, 37, 41, 42; and 3.1, 8, 10, 15, 18, 25, 27, 40.
Hom

Aer E 161
Fall 2015
Homework and Exercises 9
Exercises (to be performed during the lab on Friday, November 13)
Attend the lab session and sketch several parts in SolidWorks under the guidance of the TAs.
Homework 9 (due Wednesday, November 18, in lecture

Aer E 161
Fall 2015
Homework and Exercises 6
Exercises (to be performed during the lab on Friday, October 16)
10.1, 6, 17, 23; 11.2, 13, 17; 12.5, 15, 19; 14.1, 2, 3, 9
Homework 6 (due Wednesday, October 21, in lecture at 9am)
Problem description:
There a

Lecture 8, $815 15m 2016.
Strings
Strings are arrays (vectors) with character elements.
String constants are enclosed in single quotes.
—Characters include letters of the alphabet, digits, punctuation marks,
white space, and control characters:
0 Control

Lecture 7, fab 10m 2016
User-Defined Functions
User defined MATLAB functions are written in M-files. Access a
new function M-file the same way a script M-file is created: select
File a New —> m—file from the menu bar.
There are several advantages to split

^[.ectur G, feb rtt 2oro.
Gontrol Flow in MATLAB
There are occasions that we want to repeat a segment of code a
number of different times.
tooo:
fficfw_,;t-";g"o
Loops with iteration variable: For-Loops
We use For-Loop when we know in advance how many tim

%Aer E 161, S15, Numerical Techniques and MATLAB Programming
%Alexis Palliser
%April 10, 2015
disp('Problem 3: ') %Printing the problem number
r=input('What is the radius of the circle? '); %Asking for a radius
P=Perimeter(r); %Calling the function and ca

Lecture 30, Apr 16f,i 2014.
Chapter: Ordinary Differential Equations.
Initial-Value Problem (IVP):
(l) 39 QCCXig) )(oSXEXn gunk?
x0 - is called initial point, yo - the initial value.
Eulers Method or
Euler-Cauch y Method
Solwh'on
Ya 19
X| 3
X2. g1
Km

t
Lecture 27 (FORTRAN), $41977 2014.
ALLOCATABLE Anays
In all of our examples, that we have seen so far, the size of each array was
declared in a type declaration statement at the beginning of the program.
REAL, DIMENSION(3) : v, t
or
REAL : V(3), t(3)
Th

ecture 26, Apr 4m 2014.
Chapter: Numerical Differentiation.
Numerical differentiation is useful in estimating the derivative of a
function when either function f (x) is difficult to differentiate easily, or it
is not known as an explicit expression in x,

ecture 26, 54101 4m 2014.
Chapter: Numerical Integration
Gauss Quadrature
We wish to find a definite integral:
%
I: fo)69<
Numerical integration methods we studied before were based on
evenly spaced function values. Consequently, the location of the base

Lecture 31, Apr 18% 2014.
Chapter: Ordinary Differential Equations.
Fourth-order Runge-Kutta Method
The most popular and most commonly used formula of
Runge-Kutta methods. The local error term for RK4 is proportional to
h5, the global error would be about

ecture 29, lpr 14m 2014.
Ordinary Differential Equations
Differential equations (DE) are used extensively in engineering
and science to represent physical phenomena of a problem (problems).
A differential equation is an equation involving functions and th

Lecture 32, Apr 21St 2014.
Numerical Methods in MATLAB
Root Finding.
MATLAB features only two functions for the root finding:
fzero - applicable for any function of one variable
roots - used to find the roots of polynomials.
fzero use the zeroin algorithm

Lecture 28, Apr 9mL 2014.
Chapter: Numerical Differentiation
Two-point Formula.
To nd the approximation of the first derivative of a function at a
given point, consider two distinct points x0 and x1,
x. X.=X~+h
The linear Lagrange interpolating polynomi