Vous êtes sur la page 1sur 3

Fundamental of MATLAB

Part: I Introduction to MATLAB

1. List the major components the MATLAB environment.


2. How can help be sought for various commands in MATLAB? Describe the various commands
used for seeking help.
3. Explain different types of files in MATLAB.
4. List out use of MATLAB in Electronics & Communications field. Explain one use in brief.

Part: II Constants, variables and Expressions

1) Express (1+ 2j) and (-2+j1) in polar form using MATLAB.


Ans: 2.2361 and 1.1071, 2.2361 and 2.6779
2) Find out following statements in editor
i) = 2 log + cos + 5 + | − | = 2, = 4 =3
Answer: 19.9319
ii) = , = 1, = 2 =3
Answer: 1
3) Find out following trigonometric functions for theta= 30, 60 and 120 degree.
i) sin + cos Answer: 1.3660 1.3660 0.3660
ii) sin 2 + cos 2 Answer: 1.3660 0.3660 -1.3660
4) For a first order control system subjected to unit step input, the output response is given by
( )=1− /
. Write a program in editor to find out c (t) for = 4 and t varies from 0
to 10 second in interval of 0.01 second. Also, plot t v/s c(t) .

Part: III Vector and Matrices

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

3) List out use of following commands with examples


a) : i) size
b) linspace j) zeroes
c) length k) ones
d) ceil l) eye
e) floor m) rand
f) sort n) diag
g) find o) \ (left Division)
h) mod
4) Solve the following sets of algebraic equations 5 − 3 + 2 = 10, −3 + 8 + 4 =
20 2 + 4 − 9 = 9 using
a) Left division
b) Using Gaussian Elimination
c) By Inverse operator

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) Explain following commands with example


a) input
b) keyboard
c) menu
d) pause
e) load
f) save
g) format
h) disp
i) fprintf
2) Write a program in editor for adding, subtraction, multiply and division of two number given by
command prompt and operation selected by menu and answer should display in long format.
3) Write a program in editor for finding area and circumference of a circle. Radius will be given by
command prompt.
4) Write a program in editor for converting pressure from KPa to bar and vice versa.
[ Hint: 100Kpa = 1 bar]

Part: VI MATLAB Graphics

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

Part: VII Control Structures

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