MTH643 – MTH643: Midterm Important MCQs (58 Solved Questions)
Virtual University of Pakistan • Read every solved MCQ with its verified answer key directly on this page. Free, no login required.
All 664 Midterm Packs · MTH643 Course Page · MTH643 Subjective Pack (49 Q&As)
-
What does the clc command do in MATLAB?
Topic: MATLAB Basics and Workspace Commands
- Deletes all variables from the workspace
- Clears the Command Window ✓ Correct answer
- Closes all figure windows
- Clears the command history
-
The command clear all is used to:
Topic: MATLAB Basics and Workspace Commands
- Remove all variables from the workspace ✓ Correct answer
- Format the output display
- Close the MATLAB editor
- Clear only the Command Window
-
What is the effect of the close all command?
Topic: MATLAB Basics and Workspace Commands
- It closes MATLAB completely
- It saves and closes the current script
- It closes all open figure windows ✓ Correct answer
- It closes the workspace variables
-
Which symbol is used to write a comment in MATLAB?
Topic: MATLAB Basics and Workspace Commands
- //
- #
- % ✓ Correct answer
- /* */
-
MATLAB script files are saved with the extension:
Topic: MATLAB Basics and Workspace Commands
- .mat
- .m ✓ Correct answer
- .mlx
- .txt
-
Ending a MATLAB statement with a semicolon (;) :
Topic: MATLAB Basics and Workspace Commands
- Terminates the MATLAB session
- Suppresses the display of the result ✓ Correct answer
- Makes the variable symbolic
- Doubles the value of the result
-
How many elements does the vector x = 0:0.1:5 contain?
Topic: MATLAB Basics and Workspace Commands
- 50
- 5
- 11
- 51 ✓ Correct answer
-
If x = 15, then sqrt(x) displayed in short format is:
Topic: MATLAB Basics and Workspace Commands
- 3.8730 ✓ Correct answer
- 3.8070
- 4.8730
- 3.7830
-
When a result is not assigned to any variable, MATLAB stores it in the default variable:
Topic: MATLAB Basics and Workspace Commands
- result
- output
- ans ✓ Correct answer
- temp
-
The area of a triangle with base 6 and height 7, computed as A = 1/2*base*height, is:
Topic: MATLAB Basics and Workspace Commands
- 42
- 13
- 21 ✓ Correct answer
- 84
-
The syms command is used to:
Topic: Symbolic Math — syms, subs and solve
- Create a numeric vector
- Declare symbolic variables ✓ Correct answer
- Plot a symbolic graph
- Save the workspace
-
In MATLAB, subs(u, x, 5) performs which operation?
Topic: Symbolic Math — syms, subs and solve
- Solves u for x = 5
- Differentiates u at x = 5
- Substitutes x = 5 into the symbolic expression u ✓ Correct answer
- Integrates u from 0 to 5
-
For u(x, y) = 2x + xy² + 3y, substituting x = 5 gives:
Topic: Symbolic Math — syms, subs and solve
- 5y² + 3y + 10 ✓ Correct answer
- 5y² + 15y
- 2y² + 3y + 5
- 10y² + 3y + 2
-
Using subs, the value of f(x) = sin(x) at x = π/2 is:
Topic: Symbolic Math — syms, subs and solve
- 0
- 1 ✓ Correct answer
- -1
- π/2
-
The exact symbolic value of cos(π/2) is:
Topic: Symbolic Math — syms, subs and solve
- 1
- 0.5
- 0 ✓ Correct answer
- -1
-
The exact symbolic value of tan(π/2) is:
Topic: Symbolic Math — syms, subs and solve
- 0
- 1
- -1
- Inf (undefined) ✓ Correct answer
-
If y = sqrt(15) and w = x^y * sin(π) is evaluated symbolically, then w equals:
Topic: Symbolic Math — syms, subs and solve
- 15
- 1
- 0 ✓ Correct answer
- 3.8730
-
The value of Z = (x + y)^6 / (x²y) at x = 6, y = 7 is:
Topic: Symbolic Math — syms, subs and solve
- 4826809/252 ✓ Correct answer
- 19154/7
- 13^6/42
- 252/4826809
-
For p(x, y) = x² + 3y²x + 10, substituting x = 2 gives:
Topic: Symbolic Math — syms, subs and solve
- 6y² + 14 ✓ Correct answer
- 3y² + 12
- 12y² + 10
- 6y² + 10
-
For u(x) = x³ + 4x + 10, the value at x = 2 is:
Topic: Symbolic Math — syms, subs and solve
- 24
- 26 ✓ Correct answer
- 30
- 18
-
The solve command is used to:
Topic: Symbolic Math — syms, subs and solve
- Substitute values into an expression
- Find symbolic solutions of equations ✓ Correct answer
- Expand a polynomial
- Create a mesh grid
-
For the system x + y + z = 2, -x + y - z = 3, x + 2y + 3z = -10, the value of z is:
Topic: Symbolic Math — syms, subs and solve
- 27/4
- 5/2
- -29/4 ✓ Correct answer
- 29/4
-
One solution of the system x² - y = 2 and y - 2x = 5 has x equal to:
Topic: Symbolic Math — syms, subs and solve
- 1 + 2√2 ✓ Correct answer
- 3
- -2
- 1 - √2
-
The real root of the equation 2x³ + x² + 3x + 4 = 0 is:
Topic: Symbolic Math — syms, subs and solve
- x = 1
- x = -1 ✓ Correct answer
- x = -2
- x = 0.25
-
Which pair solves both 2x + 7y = 3 and 3x² + 2y = 1?
Topic: Symbolic Math — syms, subs and solve
- x = 1, y = 0
- x = 1/3, y = 1/3 ✓ Correct answer
- x = -1/7, y = 3/7
- x = 3, y = -3/7
-
The highest-degree term in the expansion of x(x + y)³(x - y)² is:
Topic: Symbolic Math — syms, subs and solve
- x⁵y
- 2x⁴y²
- xy⁵
- x⁶ ✓ Correct answer
-
For f(x, y) = xye^(-x-y), the partial derivative ∂f/∂x is:
Topic: Symbolic Math — syms, subs and solve
- ye^(-x-y)(1 - x) ✓ Correct answer
- xe^(-x-y)(1 - y)
- xye^(-x-y)
- ye^(-x-y)(1 + x)
-
The meshgrid command is used to:
Topic: Plotting — plot, ezplot, contour and meshgrid
- Solve a system of equations
- Create two-dimensional coordinate grids for surface and contour plots ✓ Correct answer
- Display a menu of plots
- Merge two figure windows
-
The contour(X, Y, Z) command draws:
Topic: Plotting — plot, ezplot, contour and meshgrid
- A bar chart of Z
- The contour lines (level curves) of the surface Z ✓ Correct answer
- A three-dimensional mesh only
- The roots of Z
-
If no interval is given, ezplot draws the graph on the default interval:
Topic: Plotting — plot, ezplot, contour and meshgrid
- [0, 1]
- [-1, 1]
- [-π, π]
- [-2π, 2π] ✓ Correct answer
-
The purpose of the hold on command is to:
Topic: Plotting — plot, ezplot, contour and meshgrid
- Pause the execution of the program
- Retain the current graph so that new plots are added to it ✓ Correct answer
- Hold the output in the workspace
- Stop the plotting of all graphs
-
The command axis square is used to:
Topic: Plotting — plot, ezplot, contour and meshgrid
- Convert the graph into a square matrix
- Make the plot box square with the same scale on both axes ✓ Correct answer
- Square all the data values
- Draw a square on the graph
-
To display grid lines on a graph, the command used is:
Topic: Plotting — plot, ezplot, contour and meshgrid
- grid on ✓ Correct answer
- axis grid
- plot grid
- mesh on
-
In vector plotting, the operator .^ is used because it performs:
Topic: Plotting — plot, ezplot, contour and meshgrid
- Matrix power
- Element-wise (array) power ✓ Correct answer
- Symbolic power only
- Power of a scalar only
-
For plot(x, y) to work directly, x and y must be:
Topic: Plotting — plot, ezplot, contour and meshgrid
- Symbolic expressions
- Matrices of different sizes
- Numeric vectors of the same length ✓ Correct answer
- Single scalar values
-
An anonymous function handle in MATLAB is created with the symbol:
Topic: Plotting — plot, ezplot, contour and meshgrid
- $
- @ ✓ Correct answer
- &
- ~
-
In the matrix A = [x 3 1; 2 2 7; 4 3 y], the semicolon is used to:
Topic: Matrices in MATLAB
- End the command
- Separate the columns
- Separate the rows ✓ Correct answer
- Multiply the rows
-
For A = [x 3 1; 2 2 7; 4 3 y], after substituting x = 3 and y = 7, the element A(3, 3) is:
Topic: Matrices in MATLAB
- 3
- 1
- 4
- 7 ✓ Correct answer
-
The expression A(:, 2) refers to:
Topic: Matrices in MATLAB
- The second row of A
- All rows of the second column of A ✓ Correct answer
- Only the element A(2, 2)
- The last column of A
-
If A = [3/11 2/5 4/7; 2/3 4/5 6/5], then sum(A(:, 2)) equals:
Topic: Matrices in MATLAB
- 6/5 ✓ Correct answer
- 4/5
- 2
- 22/15
-
The command inv(A) returns:
Topic: Matrices in MATLAB
- The transpose of A
- The determinant of A
- The inverse of matrix A ✓ Correct answer
- The eigenvalues of A
-
If A = [1 3; 2 4] and B = [-2; 3], then X = inv(A)*B has first entry:
Topic: Matrices in MATLAB
- -3.5
- 8.5 ✓ Correct answer
- 2
- -8.5
-
The rref command computes the:
Topic: Matrices in MATLAB
- Rank of a matrix
- Reduced row echelon form of a matrix ✓ Correct answer
- Reciprocal of a matrix
- Roots of a polynomial
-
Writing the system 2x + y + z = 2, -x + y - z = 3, x + 2y + 3z = -10 in augmented form and applying rref gives z equal to:
Topic: Matrices in MATLAB
- -5 ✓ Correct answer
- 5
- -10
- 1
-
Which of the following is (approximately) an eigenvalue of A = [3 1 4; 7 8 9; 3 1 3]?
Topic: Matrices in MATLAB
- 5.5000
- -2.1000
- 11.3007 ✓ Correct answer
- 0.0000
-
The statement name = input('Enter name: ', 's') takes the input as:
Topic: Programming — Loops, Input/Output and Functions
- A number
- A string (text) ✓ Correct answer
- A matrix
- A symbolic variable
-
The disp command is used to:
Topic: Programming — Loops, Input/Output and Functions
- Display text or a value without showing the variable name ✓ Correct answer
- Delete a variable
- Take input from the user
- Display the workspace
-
In an fprintf format string, the placeholder %s is used for:
Topic: Programming — Loops, Input/Output and Functions
- An integer
- A floating-point number
- A string ✓ Correct answer
- A matrix
-
The value of mod(10, 3) is:
Topic: Programming — Loops, Input/Output and Functions
- 3
- 1 ✓ Correct answer
- 0
- 3.3333
-
A for loop that adds the numbers 5, 10, 15, ..., 100 gives the sum:
Topic: Programming — Loops, Input/Output and Functions
- 1000
- 1050 ✓ Correct answer
- 950
- 2100
-
The sum of the first 30 odd numbers, computed with a for loop, is:
Topic: Programming — Loops, Input/Output and Functions
- 870
- 930
- 900 ✓ Correct answer
- 450
-
A loop computing the factorial of 10 gives:
Topic: Programming — Loops, Input/Output and Functions
- 362880
- 3628800 ✓ Correct answer
- 39916800
- 720
-
The sum Σ (3/x)^k for k = 1 to 12, with x = 4, is approximately:
Topic: Programming — Loops, Input/Output and Functions
- 3.0000
- 1.9050
- 2.9050 ✓ Correct answer
- 4.0000
-
The highest common factor (HCF) of 12 and 18 is:
Topic: Programming — Loops, Input/Output and Functions
- 3
- 36
- 6 ✓ Correct answer
- 9
-
Every number divisible by both 3 and 5 is also divisible by:
Topic: Programming — Loops, Input/Output and Functions
- 8
- 15 ✓ Correct answer
- 30 only
- 45 only
-
The menu command in MATLAB is used to:
Topic: Programming — Loops, Input/Output and Functions
- Open the main MATLAB menu
- Display a pop-up menu and return the number of the chosen option ✓ Correct answer
- Create a script file
- List all user-defined functions
-
A function computing the circumference 2πr of a circle gives, for r = 7, approximately:
Topic: Programming — Loops, Input/Output and Functions
- 21.99
- 43.98 ✓ Correct answer
- 153.94
- 7.00
-
In a for loop computing sin(i) for i = 0, 1, 2, the last value displayed is approximately:
Topic: Programming — Loops, Input/Output and Functions
- 0.8415
- 0.0000
- 1.0000
- 0.9093 ✓ Correct answer