HOMEWORK 1
Problem 1: Create a script (.m file) which calculates the circumference of a circle.
Filename: circle_circumference.m
Input: radius
Output: circumference
Problem 2: Create a script (.m file) which calculates the area of a circle.
Filename: circ
Questions general
TEST 1 Review
EXCEL questions
1. The icon for cut is a
(a) magnifying glass
(b) scissors
(c) eyeglasses
(d) binoculars
(c) 5
(d) =5
2. The cell reference A5 refers to what column
(a) A
(b) =A
3. The formula =A5 + d1 is in cell B3 if the
EGR 150
Test #2 Review
March 2013
1. What is the value of sum at the end of the loop?
sum = 0;
for n = 0:5
if n = 0;
f = 1;
else
f = f * n;
sum = sum + f;
end;
end
(a)sum =130 (b) sum= 120 (c)sum =33 (d)sum =153 (e) None of Above
n
fs
fe
sums
sume
0
1
2
3
EGR 150
Test #2 Review
March 2013
1.
What is the value of sum at the end of the loop?
sum = 0;
for n = 0:5
if n = 0;
f = 1;
else
f = f * n;
sum = sum + f;
end;
end
(a)sum =130 (b) sum= 120 (c)sum =33 (d)sum =153 (e) None of Above
n
fs
fe
sums
sume
0
1
2
3
Homework 4
1. Consider the problem that MATLAB has in separating the following string into the variable to the
left of the equal sign and the vector to the right of the equal sign:
' v= [1234;5,6,7;8;9 10] ' or 'a_variable = [26,7;9,6,1 ]'
Your script mus