0% found this document useful (0 votes)
15 views4 pages

Second Lab

The document discusses how to use MATLAB to: 1) Solve equations and find determinants of matrices. 2) Plot various functions individually and on the same figure using different commands like plot, stem, subplot. 3) Adjust axis limits and customize plots by changing colors and notations. 4) Examine the effect of changing the input vector on plots of functions like cosine. The questions cover key MATLAB skills like solving systems of equations, plotting functions, customizing plots, and working with vectors and matrices.

Uploaded by

ARSLAN HAIDER
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views4 pages

Second Lab

The document discusses how to use MATLAB to: 1) Solve equations and find determinants of matrices. 2) Plot various functions individually and on the same figure using different commands like plot, stem, subplot. 3) Adjust axis limits and customize plots by changing colors and notations. 4) Examine the effect of changing the input vector on plots of functions like cosine. The questions cover key MATLAB skills like solving systems of equations, plotting functions, customizing plots, and working with vectors and matrices.

Uploaded by

ARSLAN HAIDER
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Introduction To MATLAB

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

x 2y z 3


5y z 2

3x 2y z 7
4y z 2

3x 2y 9z 65


9x + 5y 2z 16
6x 7y 3z 5

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

5x 2y 9z 44


9x 2y 2z 11
6x 7y 3z 44

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:

Plot the following functions, Take any input vector

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,

1. Display them in different colors(Color Specifier are given in the end)


2. Different Notations.

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:

axis ( [xmin xmax ymin ymax] )

y = sin(2x + 3) for 0 ≤ x ≤ 5 and -1 ≤ y ≤ 1.


y=e −3/2x
sin(5x + 3) for 0 ≤ x ≤ 5 and -1 ≤ y ≤ 1.

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

-----------------------------------------------------------------------------------------------------------------

You might also like