MCQs on Introduction to MATLAB | MATLAB

1. Overview of MATLAB Environment

  1. MATLAB primarily stands for:
    a) Matrix Laboratory
    b) Math Laboratory
    c) Machine Learning Laboratory
    d) Matrix Loop Analyzer
  2. Which of the following is NOT a component of the MATLAB environment?
    a) Command Window
    b) Live Script Editor
    c) Browser Console
    d) Workspace
  3. What is the file extension for MATLAB script files?
    a) .mtlb
    b) .mlab
    c) .m
    d) .mat
  4. The “Start” button in MATLAB refers to:
    a) Opening a new script
    b) Accessing the MATLAB Home menu
    c) Running the installed toolbox
    d) Initiating the debugger
  5. What does the MATLAB Command History display?
    a) Syntax errors
    b) Previous commands executed
    c) Current workspace variables
    d) File import logs

2. Command Window, Workspace, and Editor

  1. What is the primary purpose of the MATLAB Command Window?
    a) To edit functions
    b) To execute commands directly
    c) To visualize data
    d) To debug scripts
  2. Which MATLAB component shows the active variables and their values?
    a) Command History
    b) Editor
    c) Workspace
    d) Figure Window
  3. What shortcut allows you to clear the Command Window?
    a) clw
    b) clear all
    c) clc
    d) close all
  4. The MATLAB Editor is used for:
    a) Viewing variable properties
    b) Writing and editing scripts
    c) Displaying plot results
    d) Managing workspace data
  5. Which workspace command removes all variables from memory?
    a) clear
    b) delete
    c) clc
    d) reset

3. Basic Operations and Syntax

  1. What is the result of 5^2 in MATLAB?
    a) 10
    b) 25
    c) 52
    d) Error
  2. Which symbol is used for element-wise multiplication in MATLAB?
    a) *
    b) .*
    c) **
    d) /
  3. How do you assign the value 10 to variable x?
    a) x:10
    b) x <- 10
    c) x = 10
    d) assign x 10
  4. What function is used to determine the size of a matrix?
    a) length()
    b) dim()
    c) size()
    d) rows()
  5. Which command will concatenate two matrices horizontally?
    a) [A; B]
    b) [A, B]
    c) merge(A, B)
    d) combine(A, B)
  6. In MATLAB, A == B checks:
    a) Memory address comparison
    b) Value equality
    c) Variable names
    d) Object properties
  7. What is the use of the semicolon (;) in MATLAB commands?
    a) End the program
    b) Suppress output
    c) Define matrices
    d) Join two lines of code

4. Scripts and Live Scripts

  1. Scripts in MATLAB are:
    a) Executable files
    b) Interactive plots
    c) Collections of data
    d) Static webpages
  2. What is the default extension for MATLAB live scripts?
    a) .live
    b) .m
    c) .mlx
    d) .log
  3. Which of the following describes live scripts in MATLAB?
    a) Used only for data storage
    b) Mixes code with formatted text and visualizations
    c) Operates as external executables
    d) Runs without variables
  4. How do you execute a MATLAB script named example.m?
    a) Press F5
    b) Type run example.m
    c) Both a and b
    d) Open in Command History
  5. Which function is used to display formatted text in live scripts?
    a) disp()
    b) text()
    c) publish()
    d) format()
  6. Can live scripts display 3D plots interactively?
    a) Yes
    b) No
  7. Scripts in MATLAB cannot:
    a) Contain conditional statements
    b) Accept input arguments directly
    c) Perform loops
    d) Generate plots
  8. How can you convert a script into a live script?
    a) Rename it to .mlx
    b) Use the “Convert to Live Script” option
    c) Save it as .live
    d) It cannot be converted
  9. Which command allows the inclusion of headings in a live script?
    a) %
    b) %%
    c) ###
    d) @@
  10. How can a MATLAB live script be exported to PDF?
    a) Use exportToPDF()
    b) Select “Save As” -> PDF format
    c) Press F6
    d) It cannot be exported
  11. What happens if a MATLAB script has an error?
    a) The script stops execution
    b) MATLAB displays a warning but continues
    c) The script runs partially
    d) The error is ignored
  12. What does the “Publish” option do in MATLAB scripts?
    a) Saves it to the cloud
    b) Converts it to HTML or PDF
    c) Debugs the code
    d) Deletes unused variables
  13. Live scripts are preferred over traditional scripts for:
    a) Memory optimization
    b) Combining code and rich documentation
    c) Faster execution speed
    d) Limited toolbox usage

Answer Key

QnoAnswer
1a) Matrix Laboratory
2c) Browser Console
3c) .m
4b) Accessing the MATLAB Home menu
5b) Previous commands executed
6b) To execute commands directly
7c) Workspace
8c) clc
9b) Writing and editing scripts
10a) clear
11b) 25
12b) .*
13c) x = 10
14c) size()
15b) [A, B]
16b) Value equality
17b) Suppress output
18a) Executable files
19c) .mlx
20b) Mixes code with formatted text and visualizations
21c) Both a and b
22a) disp()
23a) Yes
24b) Accept input arguments directly
25b) Use the “Convert to Live Script” option
26b) %%
27b) Select “Save As” -> PDF format
28a) The script stops execution
29b) Converts it to HTML or PDF
30b) Combining code and rich documentation

Use a Blank Sheet, Note your Answers and Finally tally with our answer at last. Give Yourself Score.

X
error: Content is protected !!
Scroll to Top