Beruflich Dokumente
Kultur Dokumente
3 4 5 2
1) Given the matrix = 5 6 7 4
7 8 9 4
a) Reshape this matrix as
i) Column Vector
ii) (4 X 3) Matrix
iii) (6 X 2) Matrix
0
b) Given a column vector, = 1 and a row vector = [0 2 3 4 ], append these
2
column/row vectors to the matrix P, given above.
5 6
2) Consider the matrix A is given by: = 3 −4 10 where PRN is your last three digit of
7 11 8
your PRN number. Find out following function using MATLAB.
a) Rank of A d) Determinant of A
b) Trace of A e) Inverse of A
c) Eigen Value and Eigen Vector f) Transpose of A
g) Characteristics Equation of A h) Sign of A
Part: IV Polynomials
1) Obtain the value of ( ) = + 4 + 1 at s=-2, s=2+4j. And also find roots of equations
Answer: -3 and -3.0000 +32.0000i and roots are -3.7321 and -0.2679
2) ( ) = + + 1 and ( ) = + + 3 + 1, do following operations
a) Add both polynomial [1 2 4 2]
b) Subtract (p-q) polynomial [-1 0 -2 0]
c) Multiply both polynomial [1 2 5 5 4 1]
d) Divide p/q polynomial (Please write quotients and reminders part) q=0 , r= [1 1 1]
3) Find out polynomial from roots 2, 4 and 6. 1 [-12 44 -48]
4) Given the data below, fit a polynomial of degree 2 1.0000 2.0000 4.0000
M 2 5 7
N 12 39 67
Part: V Input and Output Statements
1) Plot Sine wave from 0 to 2*pi using plot, area and with xlabel, ylabel, title, grid, text and gtext.
2) Plot Sine wave and cos wave from 0 to 2*pi using plot, hold command and with xlabel, ylabel,
title, grid, legend.
3) Using subplot (use 3 row and 2 column )draw following plot (Assume suitable data) in
a) Bar graph
b) Pie graph
c) Stem Function
d) Polar Function
e) Semilogx graph
f) Loglog graph
4) Explain following three dimensional plots with suitable examples
a) plot3
b) bar3
c) mesh
d) surf
e) contour
1) Write a program in editor to find out whether a given number is ‘odd’ or ‘even’ using if structure
a) Without ‘else’ option
b) With ‘else’ option
2) Write a program to find out number of integers that are grater then 50 but less than 250 that
are divisible by 11. Also find the sum of these numbers.
3) Write a program using while loop to reverse the digits of a number having minimum three digits.
Also use error statement and try –catch if given number is more than 3 digits.
4) Explain following with suitable examples
a) switch statement
b) break
c) continue
d) nested if
e) nested for