Professional Documents
Culture Documents
QUIZ 1 - Set B
QUIZ 1 - Set B
SEAA 2413
QUIZ 1
Lecturer:
Ts D r N u r u l ‘A z i z a h M u k h l a s
Q1
3 3 3 3 3
K = −3 −1 1 3 5
9 4 −1 −6 −11
a) Create matrix K (use colon or linspace and other special matrices, do not
key-in the elements one-by-one), then,
Write and use MATLAB program for the following array y to:
3
3
Q3
Data 1 2 3 4 5
Force, F 10 20 20 10 30
Mass, m 2 2 4 2 2
Acceleration, 𝑎
4
4
Q4
A company must purchase five kinds of material. The following table gives
the price the company pays per ton for each material, along with the number
of tons purchased in the months of May, June and July.
Write MATLAB command to answer the below questions. You may create
your own variables.
a) Create a 5x3 matrix containing the amounts spent on each item for each
month
b) What is the total spent in each month?
c) What is the average of total spent on each material in the three-month
period?
d) What is the total spent on all materials in the three-month period?
5
5