EPF3109 Lab Week 3: Mathematics Operations with Arrays
Question 1
Create a column vector in which the first element is 38.5, the elements decrease with
increments of -3.5, and the last element is 0. (A column vector can be created by the
transpose of a row vector).
Question 2
Create the following matrix by using vector notation for creating vectors with constant
spacing and/or the linespace command. Do not type individual elements explicitly.
5 0 6
4 0 6
B 3 0 6
2 0 6
1 0 6
Question 3
y
x 2
2 x2 4
For function 2 x , calculate the value of y for the following values of x
using element-by-element operations: 1,2,3,4,5,6,7.
Question 4
v 2 4 6 8 10
Define the vector . Then use the vector in a mathematical expression
to create the following vectors:
1 1 1 1 1
a
a) 2 4 6 8 10
1 1 1 1 1
b 2
b) 2 4 2
6 8 102
2 2
c 1 2 3 4 5
c)
d 1 1 1 1 1
d)
Question 5
Fisheries commonly estimate the growth of a fish population using the von Bertalanffy
growth law:
L Lmax 1 e K 1
Where Lmax is the maximum length, K is a rate constant, and is a time constant. These
constants vary with the species of fish. Assuming Lmax 58cm , K 0.45 years , and
1
0.65 years , calculate the length of a fish at 0, 1, 2, 3, 4, and 5 years of age.
Question 6
Define x and y as the vectors x=[1 , 3 ,5 , 7 , 9] and y=[2 ,5 , 8 , 11 ,14 ]
Then use them in the following expressions to calculate z using element-by-element
calculations.
x y2
a) z=
x+ y
b) z=x ( x2 − y )−( x− y )2