EE 221 Numerical Computing for Engineers
Lecture #07:
Functions
(Adapted from WSU Fall 2014 semester)
EE221 Summer 2015 / lecture 07/ Flow Control - Loops
1
Loops
A sequence of calculations is repeated until either
All elements in a vector or matrix hav
EE 221 Numerical Computing for Engineers
Lecture #05:
Functions
(Adapted from WSU Fall 2014 semester)
EE221 Summer 2015 / lecture 02 / Functions in Matlab
1
Function m-files
Functions are subprograms:
Functions use input and output parameters to
communi
EE 221 Numerical Computing for Engineers
Lecture #06:
Functions
(Adapted from WSU Fall 2014 semester)
EE221 Summer 2015 / lecture 02 / Flow Control
1
Flow control
To enable the implementation of computer algorithms,
Matlab has control structures for:
Co
EE 221 Numerical Computing for Engineers
Lecture #11:
Interpolation
EE221 Summer 2015 / lecture 10/ Data fitting
1
Interpolation
Interpolation fits a real
function to discrete data.
Suppose we have some
measurement data:
x0
f0
x1
f1
x2
f2
x3
f3
x4
f4
x5
f
EE 221 Numerical Computing for Engineers
Lecture #02:
Introduction to Matlab, Simple script files
(Adapted from WSU Fall 2014 semester)
EE221 Summer 2015 / lecture 02 / Introduction to Matlab, Simple script files
1
Starting Matlab
Double click on the Mat
EE 221 Numerical Computing for Engineers
Lecture #08:
Functions
(Adapted from WSU Fall 2014 semester)
EE221 Summer 2015 / lecture 08/ FInding the Roots
1
Finding the roots
The root of a function f(x) is x0 such that f(x0) = 0.
Finding the roots of a fun
EE 221 Numerical Computing for Engineers
Lecture #13:
Differential Equations
EE221 Summer 2015 / lecture 13/ Solution of differential equations
1
Ordinary differential Equations
A prototype ordinary differential equation (ODE) is
= (, )
The f(t,y) is a f
EE 221 Numerical Computing for Engineers
Lecture #12:
Integration
(Adapted from WSU Fall 2014 semester)
EE221 Summer 2015 / lecture 12/ Integration
1
Symbolic integration
Matlab use built in int() function for integration. To calculate the following
3 1
EE 221 Numerical Computing for Engineers
Lecture #10:
Fitting of Data to a Curve
(Adapted from WSU Fall 2014 semester)
EE221 Summer 2015 / lecture 10/ Data fitting
1
Fitting a Line to Data
Given m pairs of data:
(xi, yi), i = 1, . . . , m
Find the coeff
EE 221 Numerical Computing for Engineers
Lecture #09:
Linear system and equations
(Adapted from WSU Fall 2014 semester)
EE221 Summer 2015 / lecture 09/ Linear Equations
1
System of Linear Equations
A general system of m linear equations with n unknowns c
EE 221 Numerical Computing for Engineers
Lecture #03:
Matrices and Vectors
(Adapted from WSU Fall 2014 semester)
EE221 Summer 2015 / lecture 02 / Matrices and Vectors
1
Matrices and vectors
All Matlab variables are matrices:
A vector is a matrix with on
EE221: Numerical Computing for Engineers
HW#01
HW title: Matlab Introduction, Variables, Script Files
Issued : 9th June 2015
(Sharp)
Deadline: Thursday 11th June, 2015@ 11.59pm
In this lab we will learn about running Matlab, writing script files and simpl
EE221: Numerical Computing for Engineers
HW#05
HW title: if-else, for loop, while loop
Issued: 22th June 2015
Deadline: Wednesday 24th June, 2015@ 11.59pm
Part 01: if-else statement and for loop
The solution for 2nd order differential based system can be
Helps on Part 01: Calculating cosh(x)
Write a Matlab program (it does not have to be a function, though feel free to write it as one) to
evaluate cosh(x), for an arbitrary positive value of x, using the series expansion for cosh(x):
For calculating (2n)!
EE221: Numerical Computing for Engineers
HW#03
HW title: Graph plot, functions
Issued: 15th June 2015
Deadline: Thursday 18th June, 2015@ 11.59pm
Part 01: Tangential and Radial stress calculation
The above figure shows the tangential and radial stress of
EE221: Numerical Computing for Engineers
HW#04
HW title: flow control, if-else statement
Issued: 18th June 2015
Deadline: Wednesday 20th June, 2015@ 11.59pm
Part 01: Understanding the if-else, comparison and logical operations
This problem is an extension
EE221: Numerical Computing for Eng1ineers
HW#07
HW title: Finding roots, Equations solution
Issued: 30th June 2015
Deadline: Wednesday 1st July, 2015@ 5.59pm
The main focus of this homework to learn the usage of matlab built-in functions. You can use
any
EE221: Numerical Computing for Engineers
HW#02
HW title: Variables, data types, input and output
Issued : 11th June 2015
(Sharp)
Deadline: Thursday 13th June, 2015@ 11.59pm
In this lab we will learn about different data types, variables usage , taking inp
EE221: Numerical Computing for Eng1ineers
HW#06
HW title: Finding roots, Equations solution
Issued: 25th June 2015
Deadline: Monday 29th June, 2015@ 11.59pm
Part 01: Calculating cosh(x)
Write a Matlab program (it does not have to be a function, though fee
EE 221 Numerical Computing for Engineers
Lecture #04:
Plotting Data
(Adapted from WSU Fall 2014 semester)
EE221 Summer 2015 / lecture 02 / Plotting data
1
Two dimensional plots
Two dimensional plots are created with the plot function.
Syntax of simple p