MATLAB MCQs January 8, 2026August 9, 2024 by u930973931_answers 20 min Score: 0 Attempted: 0/20 Subscribe 1. What is the default data type for variables in MATLAB? (A) Double (B) Float (C) Integer (D) String 2. How do you create a 3×3 matrix of zeros in MATLAB? (A) matrix(3,3) (B) zeros(3) (C) zeros(3,3,3) (D) zeros(3,3) 3. What does the size function do in MATLAB? (A) Returns the size of a variable (B) Resizes a variable (C) Returns the shape of a matrix (D) Deletes the variable 4. How do you create a vector with values from 1 to 10 in MATLAB? (A) 1:10 (B) linspace(1,10,10) (C) range(1,10) (D) vector(1,10) 5. How do you comment a single line in MATLAB? (A) % comment (B) # comment (C) // comment (D) /* comment */ 6. What is the output of length([1,2,3;4,5,6])? (A) 3 (B) 6 (C) 9 (D) 2 7. How do you transpose a matrix A in MATLAB? (A) A’ (B) transpose(A) (C) A.T (D) A. 8. Which function is used to plot a graph in MATLAB? (A) graph() (B) plot() (C) draw() (D) show() 9. How do you find the determinant of a matrix A? (A) det(A) (B) matrixdet(A) (C) finddet(A) (D) A.det() 10. What is the purpose of the clear command in MATLAB? (A) Clears all variables from the workspace (B) Clears the command window (C) Clears the figure window (D) Clears the current function 11. How do you create a new figure window in MATLAB? (A) newfig() (B) plot() (C) figure() (D) window() 12. What is the output of sum([1,2,3;4,5,6])? (A) [6, 15] (B) [10, 15] (C) 21 (D) [10, 11, 12] 13. How do you perform element-wise multiplication in MATLAB? (A) * (B) * (C) (D) × 14. What is the purpose of the linspace function in MATLAB? (A) Creates a matrix with random values (B) Creates a matrix with linearly spaced values (C) Creates a vector with random values (D) Creates a vector with linearly spaced values 15. How do you concatenate two matrices A and B horizontally? (A) [A B] (B) concat(A, B) (C) A+B (D) hcat(A, B) 16. Which function is used to calculate the mean of an array in MATLAB? (A) median() (B) average() (C) mean() (D) sum() 17. How do you create a 4×4 identity matrix in MATLAB? (A) diag(4) (B) identity(4) (C) ones(4) (D) eye(4) 18. What does the reshape function do in MATLAB? (A) Reverses the elements of a matrix (B) Sorts the elements of a matrix (C) Changes the dimensions of a matrix (D) Finds the maximum element of a matrix 19. How do you find the maximum value in a vector v? (A) max(v) (B) maximum(v) (C) findmax(v) (D) v.max() 20. What is the default plot line color in MATLAB? (A) Black (B) Red (C) Green (D) Blue