1. Which of the following command can be used for DOS commands?
a) msdos
b) dos
c) ds
d) not possible in MATLAB
View Answer
Answer: b
Explanation: 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
View Answer
Answer: a
Explanation: 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
View Answer
Answer: a
Explanation: 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?
system(date)
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
View Answer
Answer: a
Explanation: 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
View Answer
Answer: b
Explanation: 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.