M-Files

MATLAB

This set of MATLAB Multiple Choice Questions & Answers (MCQs) focuses on “M-Files”.

1. How would you start a debugger in MATLAB?
a) There is no M-file in MATLAB
b) Type edit in MATLAB and press Enter
c) Type debug in MATLAB and press Enter
d) Type M-file in MATLAB and press Enter

2. What is the extension of script files?
a) .m
b) .mat
c) .script
d) There is a nothing called script file

3. What is the basic difference between M-files and MAT-files?
a) There is no difference
b) MAT files are binary data files while m-files are ASCII text files
c) M files are binary data files while MAT-files are ASCII text files
d) There is no such thing as MAT files

4. What does the echo command do?
a) It echoes
b) It shows the comments present in Script files
c) It shows the commands and comments in MAT-files
d) It shows the commands and the comments in M-files

5. What will the following command do?

Load m1

a) Load the script file named ‘m1’
b) Load the function file named ‘m1’
c) Load the m-file named ‘m1’
d) There is no Load command in MATLAB

6. What will the following command do?

Save workspace

a) Saves the entire workspace as MAT file
b) Saves a variable named ‘workspace’ as MAT file
c) Saves the entire workspace as m file
d) Saves a variable named ‘workspace’ as m file

7. How do you create a function file in MATLAB?
a) Begin m-file with function definition
b) Begin script file with function definition
c) There is no such thing called function file
d) An m-file is only a function file

8. A student is repeatedly calling a function file but gets no output. She has checked the file repeatedly so finally she asked her teacher about it. The teacher checked everything and finds the error and gives her a scolding. What is a silly mistake?
a) She was calling the wrong function
b) She has placed a semicolon at the end of the line which computes the desired values
c) She has called a .m file
d) She was calling a script file

9. A function is not returning values according to desired input values. What should be the correction?
a) Include clear all at the beginning of function file
b) Include close all at the beginning of function file
c) Include echo on in the function file
d) Cannot be solved

10. MEX files work on JAVA.
a) True
b) False

Leave a Reply

Your email address will not be published. Required fields are marked *