Q-What are MEX files in MATLAB?
a) No such thing as MEX files
b) Helps to analyse commands in MATLAB
c) Allows the user to combine C source files with Matlab files
d) Same as MAT files


Answer: c
Explanation: MEX files are one of the kinds of file modes available in MATLAB. They are saved with a .mex extension. These files help in the association of C source files into the programs written in MATLAB.


Q-How to stop the execution of a chain of commands?
a) Press Ctrl +c
b) Cannot be stopped
c) Only usage of debugging mode is possible in MATLAB
d) Quit


Answer: a
Explanation: It may so happen that we want to pause the execution of a set of commands at a certain point. We only need to press Ctrl and C together to pause it. On the other hand, quit causes the MATLAB software to shut down. Debugging modes are also available in MATLAB.


Q-MATLAB allows modelling of different control systems using ___________
a) Simulink
b) Control System Toolbox
c) Not available in MATLAB as of yet
d) ezplot


Answer: a
Explanation: Simulink is a separate package which is present in MATLAB. It helps to model and analyze a control system which makes MATLAB a very powerful tool for simulating dynamic systems.


Q-What is not displayed by the Workspace?
a) Time of variable generation
b) Standard deviation of the variable values
c) Class of the variables
d) Nature of the variables


Answer: a
Explanation: By right clicking on the Workspace header, we will get to know the characteristics of the variables which are stored in the Workspace and what it can display. The time of variable generation is not present in the Workspace. It can only be seen if the variables from the workspace are saved separately using the command ‘save filename’.


Q-The function to close the windows containing graphs generated from MATLAB is __________
a) close all
b) close graphs
c) delete graphs
d) end all


Answer: a
Explanation: The command close all is a pre-defined function in MATLAB. When it is called, MATLAB will automatically shut down the separate windows that have been opened to view graphs separately. The rest of the options are wrong.


Q-Where do we need to store a function to call it in other programs?
a) The bin folder
b) Anywhere
c) The MATLAB folder
d) Desktop


Answer: a
Explanation: M-files containing only a function has to be written separately and has to be stored as .m files in the bin folder. If it stored in any other folder, MATLAB won’t be able to access the function file.


Q-To display comments of M-file, we use ____________
a) echo on
b) comment on
c) show %
d) Cannot be displayed


Answer: a
Explanation: The echo command is used to display commands present in an M-file. If the M-file has any comments, the echo command will also display the comments.


Q- To add comments in MATLAB, use _________
a) //
b) %/
c) /%
d) %


Answer: d
Explanation: The only format for adding and storing comments in MATLAB is to use the % symbol. One can choose to end a comment using %, but it is not needed.


Leave a Comment