Professional Documents
Culture Documents
Assignment Topic 1,2,3 New
Assignment Topic 1,2,3 New
Assignment Topic 1,2,3 New
programming
ASSIGNMENT TOPIC 1, 2 AND 3
QUESTION 1
1. Write a MATLAB coding to display only the final value of c from the information given
below:
• a is a vector from 1 to 5
• b = b + a (c)
• c = c + 1 until it is less or equal to length of a
• Assume b = 0 and c =0.5 initially
QUESTION 2
“A mixing tank is used to blend two materials X and Y to obtain new material Z. Material
X must be less than 40 litre while material Y can be any value. If material X is bigger,
display the ratio of X to Y. If material X is equal to Y add both materials. Otherwise,
display that the amount is unknown, tank may overflow.”
(ii) Develop an algorithm for achieving the task stated in question 2(i).
(iv) Develop a MATLAB program based on the algorithm and flowchart in question
2(i) and 2(ii).