EECS 1541 - Introduction to Computing for the Physical Sciences
1
EECS 1541 - Introduction to Computing for the Physical Sciences
Differential Equations
Mathematical model often takes the form of a differential equation, that is: an
equation that contain

EECS 1541 - Introduction to Computing for the Physical Sciences
1
EECS 1541 - Introduction to Computing for the Physical Sciences
Loops
Loops allow you to repeatedly execute blocks of statement
2 types of loops: counted loop and conditional loop
A coun

EECS 1541 - Introduction to Computing for the Physical Sciences
1
EECS 1541 - Introduction to Computing for the Physical Sciences
Arrays
Vectors and matrices are used to store set of values.
Like an array, vectors and matrices can be visualized as a tabl

EECS 1541 - Introduction to Computing for the Physical Sciences
1
EECS 1541 - Introduction to Computing for the Physical Sciences
Arrays
Vectors and matrices are used to store set of values.
Like an array, vectors and matrices can be visualized as a tabl

EECS 1541 - Introduction to Computing for the Physical Sciences
1
EECS 1541 - Introduction to Computing for the Physical Sciences
Arrays
Vectors and matrices are used to store set of values.
Like an array, vectors and matrices can be visualized as a tabl

EECS 1541 - Introduction to Computing for the Physical Sciences
1
EECS 1541 - Introduction to Computing for the Physical Sciences
Matrices in MATLAB (Part III)
Array operations on vectors and matrices
Matrix multiplication
Relational expressions with v

EECS 1541 - Introduction to Computing for the Physical Sciences
1
EECS 1541 - Introduction to Computing for the Physical Sciences
Constants
Recall that variables are used to store values that might change
Constants are values that cannot be changed at a

EECS 1541 - Introduction to Computing for the Physical Sciences
1
EECS 1541 - Introduction to Computing for the Physical Sciences
Constants
Recall that variables are used to store values that might change
Constants are values that cannot be changed at a

EECS 1541 - Introduction to Computing for the Physical Sciences
1
EECS 1541 - Introduction to Computing for the Physical Sciences
Matrices in MATLAB (Part III)
Array operations on vectors and matrices
Matrix multiplication
Relational expressions with v

EECS 1541 - Introduction to Computing for the Physical Sciences
1
EECS 1541 - Introduction to Computing for the Physical Sciences
MATLAB Scripts
A script is a text file containing a sequence of MATLAB commands
Each command usually occurs on a separate l

EECS 1541 - Introduction to Computing for the Physical Sciences
1
EECS 1541 - Introduction to Computing for the Physical Sciences
Selection statements
So far all of our scripts and functions have been made up of statements
A selection statement uses a l

EECS 1541 - Introduction to Computing for the Physical Sciences
1
EECS 1541 - Introduction to Computing for the Physical Sciences
Complex Numbers
Complex analysis is commonly used in numerical calculations and engineering
problems, such as
Complex roots

EECS 1541 - Introduction to Computing for the Physical Sciences
1
EECS 1541 - Introduction to Computing for the Physical Sciences
Final Exam
Final Exam: April 6, 2016 (7pm, LAS B)
3-hour exam
Calculator is allowed
Covers all the topics from week 1 to

% LAB2 NOOR ELAHI 213317375
% PART 1 a
fm = 10000;
fc=20000;
k=0.2;
t= 0:0.000001:0.001;
m = 3*cos(2*pi*fm.*t);
c = 10*cos(2*pi*fc*t);
s = (1+k*m).*c;
figure;
subplot(2,1,1);
grid;
plot(t,m);
xlabel('Time (s)');
ylabel('m = 3*cos(2*pi*fm.*t)');
title('plo

function [ sorted , m ] = q3sort( array )
arz = 1:length(array);
for m = 1:length(array)
p = 0;
for l = 1:length(array)
q = array(l);
if q >= p
p = q;
end
end
r= find(array>=(p),1);
arz(m) = p;
array(r) = [];
end
sorted = arz
m = mode(arz)
end

EECS 1541 - Introduction to Computing for the Physical Sciences
1
EECS 1541 - Introduction to Computing for the Physical Sciences
MATLAB Scripts: Input statements
Simplest input function in MATLAB is called input
To call it, a string is passed at the pr

EECS 1541 - Introduction to Computing for the Physical Sciences
1
EECS 1541 - Introduction to Computing for the Physical Sciences
MATLAB Scripts
A script is a text file containing a sequence of MATLAB commands
Each command usually occurs on a separate l

EECS 1541 - Introduction to Computing for the Physical Sciences
1
EECS 1541 - Introduction to Computing for the Physical Sciences
Selection statements
So far all of our scripts and functions have been made up of statements
A selection statement uses a l

EECS 1541 - Introduction to Computing for the Physical Sciences
1
EECS 1541 - Introduction to Computing for the Physical Sciences
Selection statements
So far all of our scripts and functions have been made up of statements
A selection statement uses a l

EECS 1541 - Introduction to Computing for the Physical Sciences
1
EECS 1541 - Introduction to Computing for the Physical Sciences
Matrices in MATLAB (Part III)
Array operations on vectors and matrices
Matrix multiplication
Relational expressions with v

% LAB 1 SECTION 2 (3:30pm - 6:30pm) SOLUTIONS
% NAME, STUDENT #
% Q1
% speed of light
c = 2.9979e8
% mass of the particle
mass = 9.109e-31
% velocity
v = 0.15*c
% kinetic energy in Joules
K = mass*c^2/sqrt(1-v^2/c^2)-mass*c^2
% Q2
a = 1.9;
c = 1.3;
alpha

EECS 1541
Introduction to Computing for Physical Sciences
LAB #1 (Section 03): Introduction to MATLAB (January 12, 2016)
(Due: end of the lab)
Objectives:
Familiar with working in the MATLAB environment
To learn how to create and publish a report in MATLA

EECS 1541 - Introduction to Computing for the Physical Sciences
1
EECS 1541 - Introduction to Computing for the Physical Sciences
Line and Curve Fitting
Data that we acquire to analyze can be either discrete (a set of data points) or
continuous
A very c

EECS 1541 - Introduction to Computing for the Physical Sciences
1
EECS 1541 - Introduction to Computing for the Physical Sciences
Recall: Newtons method
Consider a function f(x), we want to find the point xn such that f(xn) 0
xn
2
EECS 1541 - Introductio

1
EECS 1541 - Introduction to Computing for the Physical Sciences
Variables
To store a value in a MATLAB program, a variable is used
A variable stores a value that can be changed at any time
To create a variable, we use an assignment statement:
variabl

EECS 1541 - Introduction to Computing for the Physical Sciences
1
EECS 1541 - Introduction to Computing for the Physical Sciences
Matrices in MATLAB (Part II)
Modifying matrix elements
Adding and deleting matrix elements
Dimensions of a matrix
Vectors

Comments:
The Monthly budget worksheet shows the sources of the total income and expenses for the months of May, June,
for the months of May, June, July, and August. It uses the total expense and total income to calculate the monthly surplus.
culate the m

Sumeet Brar_x000D_213952098
Comments
The sales_record worksheet contains the names of sales people (ex.real estate
or commercial sales people) and the amount of sales they have made (in dollars)
This model will make use of an IF function. There are two po