JNTU
JNTU B.Tech IV MATLAB APPLICATIONS Previous Question Paper (September - 2020 - R15)
Answer any Five Questions. All Questions Carry Equal Marks.
Main
What are the rules to be followed while naming variables in MATLAB programming?
Answer
Variable names in MATLAB must follow these specific rules:
- The name must begin with a letter.
- The name can contain letters, digits, and underscores.
- MATLAB is case-sensitive, meaning 'Variable', 'variable', and 'VARIABLE' are treated as distinct entities.
- The name must not exceed the maximum length defined by the namelengthmax function (typically 63 characters).
- Variable names cannot be MATLAB keywords (e.g., if, for, while, end).
- Special characters like spaces, punctuation, or mathematical operators are not permitted.
What are script files? What is the advantage of using script files than typing the commands in command window?
Answer
A script file is a text file containing a sequence of MATLAB commands and statements. It has a .m extension and executes the commands in the order they are written, just as if they were typed directly into the Command Window.
The advantages of using script files over the Command Window include:
- Reusability: Scripts can be saved and executed multiple times without retyping the code.
- Modifiability: Code can be easily edited, corrected, and updated in the Editor/Debugger window.
- Complexity Management: Scripts allow for the organization of long, complex sequences of operations into logical blocks, which is not feasible in the transient Command Window.
- Documentation: Scripts can include comments to explain the logic, making the code easier to understand and share.
- Debugging: Script files support the use of breakpoints and step-by-step execution, which are essential for troubleshooting complex algorithms.
What are all in built functions for handling arrays in MATLAB? Describe them with example.
Answer
Sign in to view the complete answer paper.
Plot the function
Answer
Sign in to view the complete answer paper.
What is the use of legend command in MATLAB?
Answer
Sign in to view the complete answer paper.
List any three methods used by MATLAB for interpolation.
Answer
Sign in to view the complete answer paper.
Write the MATLAB code for dividing the polynomial
Answer
Sign in to view the complete answer paper.
Discuss the use of mesh and surf commands in MATLAB. Also explain the difference between these two.
Answer
Sign in to view the complete answer paper.
Solve the following equation by writing a MATLAB program.
Answer
Sign in to view the complete answer paper.
Create a row vector that has the elements: 6, 8.3, 81,
Answer
Sign in to view the complete answer paper.
Using the zeros, ones, and eye commands create the following array:
Answer
Sign in to view the complete answer paper.
What are nested functions? How to create nested functions in MATLAB? Explain.
Answer
Sign in to view the complete answer paper.