Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
45 views

20EC0454 - MATLAB Programming

This document contains questions related to the MATLAB Programming course. It covers three units - Introduction to MATLAB, Arrays, and Functions and Files. Some of the key questions asked are: 1) Define MATLAB and explain its features. Explain how to solve linear algebraic equations using MATLAB. 2) Consider a set of equations and write a MATLAB script to solve it. Explain the MATLAB command window, edit window and figure window. 3) Explain one dimensional and two-dimensional arrays. Write element-by-element operations on arrays. 4) Explain user defined functions. Write a function to return the maximum number from three arguments. Explain different types of user defined functions created in MATLAB. 5

Uploaded by

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

20EC0454 - MATLAB Programming

This document contains questions related to the MATLAB Programming course. It covers three units - Introduction to MATLAB, Arrays, and Functions and Files. Some of the key questions asked are: 1) Define MATLAB and explain its features. Explain how to solve linear algebraic equations using MATLAB. 2) Consider a set of equations and write a MATLAB script to solve it. Explain the MATLAB command window, edit window and figure window. 3) Explain one dimensional and two-dimensional arrays. Write element-by-element operations on arrays. 4) Explain user defined functions. Write a function to return the maximum number from three arguments. Explain different types of user defined functions created in MATLAB. 5

Uploaded by

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

Course Code: 20EC0454 R20

SIDDHARTH INSTITUTE OF ENGINEERING & TECHNOLOGY:: PUTTUR


(AUTONOMOUS)
Siddharth Nagar, Narayanavanam Road – 517583
QUESTION BANK (DESCRIPTIVE)

Subject with Code: MATLAB PROGRAMMING (20EC0454)


Course & Branch: B.Tech. – CSE, CSIT, & CSM
Regulation: R20 Year & Sem: IV-B.Tech. & I-Sem

UNIT - I
INTRODUCTION TO MATLAB
a Define MATLAB and explain its features. [L1][CO1] [6M]
1 Explain how to solve linear algebraic equations by using MATLAB with an
b [L2][CO2] [6M]
example
a What are the good programming practices for MATLAB? [L1][CO1] [6M]
2
b Describe input and output commands used in MATLAB. [L2][CO1] [6M]
What do you understand by debugging and what types of errors occur in
a [L1][CO3] [6M]
MATLAB programming?
Consider the following set of equations and Write MATLAB script to solve it.
3
6x - 4y + 8z = 112
b [L5][CO3] [6M]
-5x - 3y + 7z = 75
-5x - 3y + 7z = 75
What is the purpose of the MATLAB command window, edit window and
a [L1][CO1] [6M]
figure window?
4
List the different ways that you can get help in MATLAB. Write brief notes on
b [L1][CO1] [6M]
MATLAB help system.
a Discuss the functions of Menus and Tool bars available in MATLAB. [L2][CO3] [6M]
5
b List applications, advantages and disadvantages of MATLAB. [L1][CO1] [6M]
How are the elements in the array arranged in the computer’s memory?
a [L2][CO1] [6M]
6
b
Illustrate the MATLAB plotting commands with examples. [L3][CO6] [6M]
a
Discuss MATLAB search Path. [L2][CO1] [6M]
7
b
Explain different MATLAB files for file storage. [L2][CO1] [6M]
a
Differentiate script file and function file. [L4][CO3] [6M]
8
b
Compute volume of sphere of radius 5 cm using a MATLAB script. [L3][CO2] [6M]
a
Compare local variable and global variable in MATLAB. [L4][CO1] [6M]
9
b
How variables are initializing in MATLAB. [L2][CO2] [6M]
a
Calculate first 10 numbers of Fibonacci series and Display on MATLAB. [L3][CO2] [6M]
Examine the following MATLAB statements. Are they correct or incorrect? If
they are correct, what do they output? If they are incorrect, what is wrong with
them?
If volts>125
10 disp(‘WARNING: HIGH votage on line:’);
b [L3][CO4] [6M]
If volts>105
disp(‘WARNING: LOW votage on line:’);
else
disp(‘Line voltage is within tolerances.’)
end
Course Code: 20EC0454 R20
UNIT - II
ARRAYS
What is an array? Write short notes on one dimensional and two-dimensional
a [L1][CO1] [6M]
1 array with an example for each.
b Explain how Array addressing is done in MATLAB with examples. [L2][CO2] [6M]
a What statements are used to control the operation of while loops and for loops? [L1][CO3] [6M]
2
b Describe in brief about multidimensional array with examples. [L2][CO2] [6M]
Write Element-by-Element operation on
a (i) Array Addition and Subtraction [L2][CO2] [6M]
3 (ii) Element-by-Element Multiplication
b What is the purpose of varargin? How does it work. [L2][CO1] [6M]
Write Element-by-Element operation on
a (i) Element-by-Element Division [L1][CO2] [6M]
4
(ii) Element-by-Element Exponentiation
b Explain cell array. How does it differ from ordinary array? [L2][CO1] [6M]
a Explain about polynomial operations using arrays with examples. [L2][CO3] [6M]
5
b Define Empty array with three examples. [L2][CO2] [6M]
Describe about MATLAB array and discuss about the following functions with
6 [L2][CO3] [12M]
examples used in MATLAB program: (i) Zeros ( ). (ii) Ones ( ). (iii) Eye ( ).
Distinguish between array multiplication and matrix multiplication with an
a [L2][CO2] [6M]
example.
7
Which function is used for high level graphical display of the structure of a cell
b [L2][CO5] [6M]
array?
a Construct multidimensional arrays with the help of concatenation function. [L2][CO2] [6M]
A length-n vector can be broken down into sub vector operation of length VL.
8
b How this partitioning can be managed in the case of addition z=x+y where x [L2][CO4] [6M]
and y are vectors. Write an algorithm.
Explain about the functions to sort, rotate, permute, reshape, shift array
9 [L2][CO1] [12M]
contents and circshift array contents.
a What is structure? How does it differ from ordinary arrays and cell arrays? [L2][CO5] [6M]
Given the matrices
21 27 −7 −3
A=[ ] B=[ ]
10 −18 8 9 4
b Find (i) their array product, [L2][CO2] [6M]
(ii) their array right division (A divided by B), and
(iii) ‘B’ raised to the two-power element by element.
Course Code: 20EC0454 R20
UNIT – III
FUNCTIONS AND FILES

a Discuss about elementary mathematical function with appropriate commands. [L2][CO2] [6M]
1
b Explain pre-defined constants with examples. [L2][CO1] [6M]
a What are functions? Explain different types of functions. [L1][CO1] [6M]
2
b Explain in detail about working with data files. [L2][CO1] [6M]
What are the user defined functions? Write MATLAB program to sort vector v
a [L1][CO3] [6M]
= [23 45 12 9 5 0 19 17] using MATLAB commands.
3
b Illustrate how standard menu for a GUI can be created in MATLAB? [L3][CO1] [6M]
Mention the syntax of function statement and create a user defined function to
a [L1][CO2] [6M]
4 return the maximum number when three numbers are given as arguments.
b Explain any 3 complex number handling functions in MATLAB. [L2][CO3] [6M]
a Explain briefly about methods for calling functions. [L2][CO1] [6M]
5 Write MATLAB function to compute function circle which computes the area
b [L2][CO3] [6M]
A and circumference C of a circle, given its radius as an input argument.
Explain different types of user defined functions which are created in
a [L2][CO2] [6M]
6 MATLAB.
b Describe various MATLAB file types. [L2][CO1] [6M]
a Explain Nested function with an example. [L2][CO2] [6M]
7
b Briefly explain importing and exporting excel data files in MATLAB. [L2][CO4] [6M]
a Write short note on minimizing a function of one variable. [L2][CO3] [6M]
Rewrite a program including procedure to evaluate the function f(x,y) for any
two user specified as x & y where f(x,y) is defined as follows:
8 𝑥+𝑦 𝑥 ≥ 0 𝑎𝑛𝑑 𝑦 ≥ 0
b 2 [L2][CO4] [6M]
𝑓(𝑥, 𝑦) = {𝑥 + 𝑦 𝑥 ≥ 0 𝑎𝑛𝑑 𝑦 < 0
2 2
𝑥 + 𝑦 𝑥 < 0 𝑎𝑛𝑑 𝑦 < 0

a Write short note on Minimizing a Function of several Variable [L2][CO3] [6M]


Write a function that accepts temperature in degrees Fahrenheit (°F) and
9
b computes the corresponding value in degrees Celsius (°C). The relation [L2][CO2] [6M]
between the two is T °C = 5/9 * (T °F - 32)
a Explain ceil() , fix(), floor(), round() and sign() with examples. [L2][CO1] [6M]
Let x = -5-8i and y=10-5i. Use MATLAB to compute the following
10 expressions. Hand-check the answers.
b [L2][CO3] [6M]
i. The magnitude and angle of xy.
ii. The magnitude and angle of x/y
Course Code: 20EC0454 R20
UNIT – IV
PROGRAMMING TECHNIQUES AND PLOTTING

a How program is designed and developed in MATLAB? [L1][CO4] [6M]


1 Lists the requirements essential to producing plots that communicate
b [L1][CO6] [6M]
effectively.
a Explain Steps for developing a computer solution. [L1][CO1] [6M]
2 List various relational operators available in MATLAB with detailed
b [L2][CO4] [6M]
description.
a Explain different types of conditional statements in MATLAB with examples. [L2][CO5] [6M]
3
b How switch construct is working in MATLAB? [L3][CO4] [6M]
Describe about control-flow structures frequently used in MATLAB
a [L1][CO2] [6M]
4 programming with examples.
b Explain different types of looping instructions in MATLAB with examples. [L2][CO5] [6M]
a Compare formatted and binary I/O functions. [L2][CO1] [6M]
5
b Explain briefly about methods for calling functions. [L2][CO2] [6M]
a
Describe commonly used commands for plotting graphs in results analysis. [L2][CO6] [6M]
6
b
Write short note on Minimizing a Function of One Variable. [L2][CO2] [6M]
a
Explain about Minimizing a Function of Several Variable. [L2][CO2] [6M]
7
b
Write brief note about User defined functions in MATLAB. [L2][CO1] [6M]
a
Distinguish between plot and stem in plotting results with an example. [L2][CO6] [6M]
8
b
How does the subplot function will work in plotting graphs? [L2][CO6] [6M]
a
Explain about Exponential and Logarithmic functions. [L2][CO3] [6M]
9
b
Explain function discovery with its types. [L2][CO1] [6M]
Explain plot commands (a) plot (x,y), (b) title( ), (c) xlabel( ) (d) ylabel( ) (e)
a [L2][CO6] [6M]
10 legend ( ) in MATLAB with an example.
b Explain Three-dimensional plotting functions. [L2][CO1] [6M]
Course Code: 20EC0454 R20
UNIT – V

LINEAR ALGEBRAIC EQUATIONS


a Explain matrix methods for linear equations with example. [L1][CO2] [6M]
The following table shows how many hours reactors A and B need to produce
1 ton each of the chemical products 1, 2, and 3. The two reactors are available
for 40 and 30 hr per week, respectively. Determine how many tons of each
1 product can be produced each week.
b [L1][CO4] [6M]

a Define Rank of Matrix with suitable example. [L1][CO1] [6M]


For what values of c will the following set (a) have a unique solution and (b)
Have an infinite number of solutions? Find the relation between x1 and x2 for
2 these solutions.
b [L3][CO2] [6M]
6x1 + cx2 = 0
2x1 + 4x2 = 0

a Explain the Reduced Row Echelon Form with an example. [L2][CO1] [6M]
3 Find the system of Linear Equations using Cramer’s Rule.
b [L3][CO2] [6M]
2x + y + z = 3, x – y – z = 0, x + 2y + z = 0
a Explain Underdetermined Systems with an example. [L1][CO1] [6M]
4 Solve the following equations, using the matrix inverse method.
b [L2][CO2] [6M]
2x1 + 9x2 =5 3x1 - 4x2 =7
a Describe Matrix functions and commands for solving linear equations. [L2][CO3] [6M]
5 Write MATLAB script using left division method to solve the following set of
b equations. [L2][CO2] [6M]
5x1 - 3x2 = 21 7x1 - 2x2 = 36
Explain Flowchart illustrating a program to solve linear equations with
a [L2][CO3] [6M]
MATLAB code.
Write MATLAB script file to solve following equations.
6
3x1 + 2x2 - 9x3 = - 65
b [L2][CO2] [6M]
-9x1 - 5x2 + 2x3 = 16
6x1 + 7x2 + 3x3 = 5
a Explain how least square method is helpful to solve over determined Systems. [L2][CO1] [6M]
Write MATLAB script to solve following problem in terms of mg.

7
b [L2][CO3] [6M]

Use the matrix inverse method to solve the following set.


a 3x1 - 4x2 =5 [L2][CO2] [6M]
8
6x1- 8x2 = 2
b For what cases left division method gives error? Explain. [L2][CO4] [6M]
a Rewrite in brief about: 1) Under determined system 2) over determined system. [L2][CO1] [6M]
9
b Discuss different methods of transfer functions in MATLAB with examples. [L2][CO2] [6M]
Discuss about computational difficulties using theoretical linear algebra
a [L2][CO3] [6M]
techniques.
10
Rewrite step by step procedure to solve ordinary differential equation and give
b [L2][CO2] [6M]
one example of first order linear differential equation.

Prepared by: K D Mohana Sundaram, G Raghul & R Nabeesha

You might also like