Second Lab
Second Lab
Question 1:
1. If y has not been assigned a value, Will MATLAB allow you to define the equation x = y
^2 to store in memory for later use?
2. If the volume of a cylinder of height h and radius r is given by V = πr2h, use MATLAB to
find the volume enclosed by a cylinder that is 12 cm high with a diameter of 4 cm.
3. Display the results of sin (π/4), sin (π/3), and sin (π/2) as rational numbers. Also
consider the phase as degrees.
4. Compute ex for a few values of x. You must take minimum 20 values and take the input
as vectors.
Question 2:
Solve the following set of linear equations; also find the determinant of each of the following
3x 2y 5
6x 2y 2
3x 2y z 7
4y z 2
x 2y 3z = 12
4x y 2z = 13
9y 8z = 1
x 2y 3z = 1
x 4y 3z = 2
2x 8y z =
x 7y 9z = 12
x y 4z = 16
x y 7z = 16
2w + 4x - 3y + 29z =20
12w + 8y + 2z =10
-5w + x + 10z =40
w +x + y +z =20
Question 3:
Discuss the different format types used in MATLAB. Please write in your own words and it must
not exceed more than 5-lines.
Question 4:
Explain with examples how to add rows and columns in a defined matrix
Hint: you are advised to take row vector, column vector and 2-D, 3-D vectors respectively
Question 5:
1. Y=cos(x)
2. Y=sin(x)
3. Z=Tan(x)
4. Y=ex + tanh(x)
5. Y=sin-1(x+2)
6. Y=tanh-1(x+8)
7. Y= ex .sin(x)
8. Y=sin(x).cos(x)
9. Y=tan(x)+2ex
10. Y=e-x
Question 6:
Repeat Question 5 using stem command
Question 7:
Use the functions given in Question 5; plot multiple functions on same figure,
Question 8:
Plot the function Y= cos (T) for the following input vectors, also discuss its effects on the output
plot:
1. T=[0:100];
2. T=[0:0.1:100];
3. T=[0:0.001:100];
Question 9:
Generate a plot of following functions use axis command to adjust the limits:
Question 10:
Use the subplot command to display the multiple functions on same plot. You can use the
functions given in Question 5.
Color Table
-----------------------------------------------------------------------------------------------------------------