Final Review 2024
Final Review 2024
Final Review 2024
q1q2
F kc 2
Newtons
r
1
kc
4 o
o 8.854 x10 12 Fm 1
The charge of an electron is: q = 1.602 x 10-19 coulombs.
Matrixes
1. Write a Matlab function file that generates a (NxN) matrix A:
A should have the following properties: All odd rows should alternate between 5, Row#, 5,… while all
even rows should alternate between 1,Row#,1,Row#,…
5 1 5 1 .. 5
1 2 1 2 .. 1 The inputs to the function should be the integer N and the output should be the matrix A.
5 3 5 3 .. 5 function A=problem1(N)
A
1 4 1 4 .. 1
A(N,N)=5;
.. .. .. .. .. ..
A(2:2:N,:)=1;
1 N 1 N .. 1
for row=1:N
for col=1:2:N
A(row,col)=row;
end
end
Matrixes Operation
-2x+y=3
x+y=10
Joe and Steve are saving money. Joe
starts with $105 and saves $5 per week.
5x+3y-z=10
Steve starts with $5 and saves $15 per
3x+2y+z=4 week. After how many weeks do they have
4x-y+3z=12 the same amount of money?
3x+y+z+w=24
x-3y+7z+w=12
2x+2y-3z+4w=17
x+y+z+w=0
Plot and graph
1. Write a matlab script file that computes and plots 5 cycles of a sine wave as a function of
time?
a. Assume the sine wave has a frequency f = 100 Hz or period (cycle) T=1/f = 0.01s
b. An amplitude of A=2.0
y(t) = A sin(2*pi*f*t+phi)
Basic Matlab and Plot
Consider the following normal (Gaussian) distribution
function:
• We want to calculate
with a conditional
statement if:
Compute the
perimeter p
Displa
yp
and A
Start
Curve Fitting
• Should be able to use polyfit and polyval commands
Vietnam Population
• 2012 91.993 • 2000 77.635 • 1990 66.017
• This is the data for
• 2011 90.763 • 1999 76.597 • 1989 64.774
the Vietnamese • • •
2010 88.257 1998 75.456 1988 63.5
population (in • 2009 87.211 • 1997 74.307 • 1987 62.3
millions) from 1980 • 2008 86.177 • 1996 73.157 • 1986 60.92
to 2012. Select the • 2007 85.155 • 1995 71.996 • 1985 59.71
best curve for this • 2006 84.156 • 1994 70.825 • 1984 58.57
data and predict the • 2005 83.106 • 1993 69.645 • 1983 57.47
population of 2025. • 2004 82.032 • 1992 68.45 • 1982 56.4
• 2003 80.899 • 1991 67.242 • 1981 55.31
• 2002 79.727 • 1980 54.18
• 2001 78.686
Logistic Equation
dy
7y x2 3
dx
y ( 2) 3