This set of MATLAB Questions & Answers for Exams focuses on “System Commands – 2”.
1. Which of the following command can be used for DOS commands?
d) not possible in MATLAB
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 _________
d) Is not available in MATLAB
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 _________
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?
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
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 ‘’.
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.
6. All system commands take input within parentheses.
Explanation: 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 ___________
d) not possible
Explanation: 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
Explanation: 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.
Sanfoundry Global Education & Learning Series – MATLAB.
To practice all exam questions on MATLAB, here is complete set of 1000+ Multiple Choice Questions and Answers.
Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!