250+ TOP MCQs on System Commands – 2 and Answers

MATLAB Questions & Answers for Exams on “System Commands – 2”.

1. Which of the following command can be used for DOS commands?
a) msdos
b) dos
c) ds
d) not possible in MATLAB
Answer: b
Clarification: The correct command to work on DOS commands is dos in MATLAB. This is because it is pre-defined in the libraries of MATLAB.

2. The input to the unix command should be within _________
a) ()
b) {}
c) []
d) Is not available in MATLAB
Answer: a
Clarification: The unix command is defined in MATLAB to run unix based codes. The input to this command should always be within parentheses. Thus only () is allowed.

3. If the command, given as an input to the system command, gets executed, MATLAB returns a _________
a) 0
b) 1
c) True
d) False
Answer: a
Clarification: This the default return value of the system command. It will return a 0 if the command gets successfully executed. If not, it’ll return 1 and hence, only MATLAB will only return a 0.

4. What is the output of the following code?

a) It shows the date but MATLAB returns 1
b) It doesn’t show the date and MATLAB returns 0
c) It doesn’t show the date but MATLAB returns 1
d) It shows the date but MATLAB returns 0
Answer: a
Clarification: The code din’t work properly since it wasn’t included within ‘’. But the date, updated in the system, does get printed. Due to the aforementioned error, it shows a 1 and the dat.

5. The input to the system command is not necessarily given within ‘’.
a) True
b) False
Answer: b
Clarification: The input to the system() command has to be within ‘’. This is because the input has to be a command name and the command name is a string.

6. All system commands take input within parentheses.
a) True
b) False
Answer: a
Clarification: There isn’t a single system command in MATLAB which takes input within anything but parentheses. Hence, the above statement is true.

7. Windows Registry can be accessed by ___________
a) winqueryreg
b) winreg
c) windowsregistry
d) not possible
Answer: a
Clarification: The correct command to gain access to the windows registry is winqueryreg. The rest of the commands don’t exist.

8. How can we check the history of commands used?
a) By only clicking the up direction button
b) Using the commandhist command
c) Using the commandhistory command
d) Using the cmdhstry command
Answer: c
Clarification: It is not that we can check the history of the commands used, only, by clicking the upward direction button. It can be also checked by using the commandhistory function. Hence, using the commandhistory command is correct.

all exam questions on MATLAB,