MCQs on Developing MATLAB Applications | MATLAB

MATLAB provides powerful tools to develop interactive applications, including GUI development with App Designer, creating standalone executables, advanced user interfaces, and deploying applications. These features enable efficient development of user-friendly apps.

MCQs

1. GUI Development Using App Designer

  1. What is the primary tool in MATLAB for building graphical user interfaces (GUIs)?
    a) Simulink
    b) MATLAB App Designer
    c) GUIDE
    d) MATLAB Compiler
  2. Which of the following components is NOT typically used in App Designer for creating GUIs?
    a) Axes
    b) Buttons
    c) Tables
    d) Image processing toolbox
  3. In MATLAB App Designer, how can you update the content of a label programmatically?
    a) label.setText
    b) label.text
    c) label.Text = 'New Text'
    d) set(label, 'Text', 'New Text')
  4. What type of file is generated when you save a MATLAB App Designer project?
    a) .mat
    b) .fig
    c) .mlapp
    d) .exe
  5. What MATLAB function is used to launch an app built with App Designer?
    a) runApp
    b) startApp
    c) appDesigner
    d) app.run
  6. Which of the following is an example of a callback function in App Designer?
    a) startApp
    b) ButtonPushed
    c) editTextChanged
    d) appCallback
  7. How can you access the properties of a component (e.g., a button) in App Designer?
    a) Using the ComponentName.propertyName syntax
    b) Using the set function
    c) Through the findobj function
    d) Both a and b
  8. Which panel in App Designer is used to design the layout and UI components?
    a) Design View
    b) Code View
    c) Debug View
    d) Output Panel
  9. What is the default method for handling interactions (such as button presses) in App Designer?
    a) Through the uiwait function
    b) With event listeners
    c) Using callback functions
    d) Through the waitfor function
  10. How can you manage different app components in App Designer?
    a) By using uifigure and uicontrol
    b) Through the Component Browser in App Designer
    c) By manually coding all components
    d) Using figure and subplot

2. Creating Standalone Executables

  1. Which MATLAB tool is used to create standalone executables from MATLAB code?
    a) MATLAB Compiler
    b) App Designer
    c) MATLAB Coder
    d) MATLAB Compiler SDK
  2. What file extension does a standalone executable generated from MATLAB use?
    a) .exe
    b) .m
    c) .mlapp
    d) .p
  3. Which function is used in MATLAB to compile an app or script into an executable?
    a) matlabCompiler
    b) deployApp
    c) mcc
    d) matlab2exe
  4. What is required to run a MATLAB-based standalone executable on a machine that doesn’t have MATLAB installed?
    a) MATLAB Runtime
    b) MATLAB App Designer
    c) MATLAB Compiler SDK
    d) MATLAB Coder
  5. Which of the following MATLAB functions is used to check for the presence of MATLAB Runtime?
    a) isMATLABRuntime
    b) matlabCheck
    c) matlabroot
    d) matlab.runtime.isAvailable
  6. Can you include external files (e.g., images, other functions) when creating a standalone executable?
    a) No, only MATLAB code is included
    b) Yes, by specifying them during compilation
    c) Yes, but they must be manually added after compilation
    d) No, external files cannot be included in the executable
  7. What is the purpose of MATLAB Compiler in the context of standalone executables?
    a) To execute MATLAB code
    b) To compile MATLAB code into an executable form
    c) To generate code for external languages
    d) To deploy MATLAB apps on web servers
  8. How can you run a standalone executable created from MATLAB code?
    a) Using the MATLAB command run
    b) By directly executing the .exe file on Windows
    c) Through the mcc function
    d) Using deployApp in MATLAB
  9. Which of the following can be included in the deployment of a MATLAB standalone executable?
    a) MATLAB code
    b) Custom data files
    c) MATLAB Runtime
    d) All of the above
  10. What is the primary limitation when creating standalone executables from MATLAB code?
    a) Cannot include external libraries
    b) The executable is only compatible with Windows
    c) The standalone executable requires MATLAB Runtime for execution
    d) The code cannot use GUI elements

3. Advanced User Interfaces (Sliders, Buttons, Callbacks)

  1. Which MATLAB component is used to allow users to select a value within a range interactively?
    a) Slider
    b) Button
    c) Drop-down menu
    d) Text box
  2. What is the primary purpose of a callback function in a GUI?
    a) To display the results of a computation
    b) To create a new user interface element
    c) To define actions that happen when an event occurs (e.g., button press)
    d) To handle input data validation
  3. In MATLAB App Designer, how can you handle an event such as a button click?
    a) By using addlistener
    b) By defining a callback function for the button
    c) By using the execute function
    d) By calling uiwait
  4. What is the MATLAB function uicontrol used for?
    a) To create interactive components such as buttons and sliders
    b) To process the user input
    c) To display results in a table
    d) To initialize a GUI
  5. Which of the following would be a valid use case for a slider in a MATLAB GUI?
    a) Displaying textual information
    b) Allowing the user to adjust a parameter in a model
    c) Selecting between multiple options
    d) Showing a list of items
  6. What does the uifigure function create in MATLAB?
    a) A custom figure window for displaying graphics
    b) A figure for 3D plotting
    c) A GUI window for creating UI components
    d) A matrix for storing user input
  7. How would you set the range of a slider in MATLAB?
    a) slider.setRange(min, max)
    b) slider.Limits = [min max]
    c) set(slider, 'Range', [min max])
    d) slider.setLimits(min, max)
  8. Which component in MATLAB can be used to allow users to select multiple options from a list?
    a) Button
    b) Drop-down menu
    c) List box
    d) Text area
  9. What is the typical purpose of a “callback function” in the context of MATLAB GUIs?
    a) To initialize the app
    b) To display a message to the user
    c) To specify the action triggered by an event (e.g., button press)
    d) To set default values in input fields
  10. Which MATLAB function is used to create a toggle button?
    a) toggleButton
    b) uitogglebutton
    c) createButton
    d) uicontrol('Style', 'toggle')

Answer Key

QnoAnswer (Option with the text)
1b) MATLAB App Designer
2d) Image processing toolbox
3c) label.Text = 'New Text'
4c) .mlapp
5a) runApp
6b) ButtonPushed
7d) Both a and b
8a) Design View
9c) Using callback functions
10b) Through the Component Browser in App Designer
11a) MATLAB Compiler
12a) .exe
13c) mcc
14a) MATLAB Runtime
15d) matlab.runtime.isAvailable
16b) Yes, by specifying them during compilation
17b) To compile MATLAB code into an executable form
18b) By directly executing the .exe file on Windows
19d) All of the above
20c) The standalone executable requires MATLAB Runtime for execution
21a) Slider
22c) To define actions that happen when an event occurs (e.g., button press)
23b) By defining a callback function for the button
24a) To create interactive components such as buttons and sliders
25b) Allowing the user to adjust a parameter in a model
26c) A GUI window for creating UI components
27b) slider.Limits = [min max]
28c) List box
29c) To specify the action triggered by an event (e.g., button press)
30b) uitogglebutton

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