SMA102-MATLAB Exercise 1

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Charles Darwin University

College of Engineering, IT and Environment

SMA102: MATLAB exercise 1


Please use MATLAB to solve the following questions. Submit a single .m file in
Learnline using the Unitcode_StudentID_Year as the file name. You can submit your
solution for exercise 1 in week 11 or submit solutions for both exercises by 8 October
2023.

To find the humps function type >> plot(humps). You will generate the curve below.

100

90

80

70

60

50

40

30

20

10

0
0 5 10 15 20 25

Question 1

(i) Use quad function in matlab to integrate the humps function from -1 to 2.

+∞ 1
(ii) Use quadgk function in matlab to evaluate∫1 𝑑𝑥.
𝑥2

Question 2

Use the trapz function in matlab to integrate the following function


π/2
dx

1
0 sin2 x + 4 cos 2 x

(Divide the interval [𝜋⁄2 − 0] into 100 subintervals)

Question 3

Find the eigenvectors and then diagonalize the following matrix:


4 2 2
𝐴 = [2 4 2]
2 2 4
Resources

1) Use the getting started, documentation, and demo resources in MATLAB to learn
about functions and syntax.

2) https://au.mathworks.com/videos/new-mathematics-features-in-matlab-75-
101542.html

Marking Scheme

The following table forms the basis for the marking of MATLAB exercise 1.

Question Section description Marks


1
i) Use quad function 1

ii) Use quadgk function 1

2 Use the trapz function 1

3 Find the:
eigenvectors of A 1

diagonalize A 1
Total 5

You might also like