Blog

Keep up to date with the latest news

Updated MATLAB MCQs – Advanced Software Development ( MATLAB ) MCQs

Updated MATLAB MCQs – Advanced Software Development ( MATLAB ) MCQs

Latest MATLAB MCQs

By practicing these MCQs of Advanced Software Development ( MATLAB ) MCQs – Latest Competitive MCQs , an individual for exams performs better than before. This post comprising of objective questions and answers related to Advanced Software Development ( MATLAB ) Mcqs “. As wise people believe “Perfect Practice make a Man Perfect”. It is therefore practice these mcqs of MATLAB to approach the success. Tab this page to check ” Advanced Software Development ( MATLAB )” for the preparation of competitive mcqs, FPSC mcqs, PPSC mcqs, SPSC mcqs, KPPSC mcqs, AJKPSC mcqs, BPSC mcqs, NTS mcqs, PTS mcqs, OTS mcqs, Atomic Energy mcqs, Pak Army mcqs, Pak Navy mcqs, CTS mcqs, ETEA mcqs and others.

MATLAB MCQs – Advanced Software Development ( MATLAB ) MCQs

The most occurred mcqs of Advanced Software Development ( ) in past papers. Past papers of Advanced Software Development ( MATLAB ) Mcqs. Past papers of Advanced Software Development ( MATLAB ) Mcqs . Mcqs are the necessary part of any competitive / job related exams. The Mcqs having specific numbers in any written test. It is therefore everyone have to learn / remember the related Advanced Software Development ( MATLAB ) Mcqs. The Important series of Advanced Software Development ( MATLAB ) Mcqs are given below:

Calling External Functions

1. What is the function of the mexext command?
a) Reveals the version of the MEX file
b) Reveals the package in which the MEX file is stored
c) Returns the extension of the MEX file for the system
d) Error
Answer: c
Explanation: The MEX file, generated in MATLAB will have an extension which depends on system configurations. Hence, the above code returns the extension of the MEX file when generated from the current system.

2. What is the output of the following code?

Mexext(all)

a) Error
b) Returns a structure of arrays of MEX extensions
c) Returns an array of structures of MEX extensions
d) Returns the system version of MEX file
Answer: a
Explanation: The mexext file is misspelled with the ‘M’, it should’ve been small. The MEX extensions would’ve been shown if the command was written properly.

3. What is the output of the following code snippet?

computer

a) Shows the system version
b) Shows the MATLAB version
c) Shows the previous MATLAB versions in the current system
d) Error
Answer: a
Explanation: It shows the version of the system where MATLAB is installed currently.

4. What is the output of the following code?

loadlibrary()

a) Load a C library
b) Load a C function
c) Load a C header file
d) Load a C file
Answer: a
Explanation: The above command typically loads a C library with all the header files and the functions so that they can be used in the MATLAB code.

5. The callib command implements the function from a _________
a) library loaded by the loadlibrary() command
b) .h file loaded by the loadlibrary() command
c) c-file loaded by the loadlibrary() command
d) function loaded by the loadlibrary() command
Answer: a
Explanation: The callib command is defined in MATLAB to use a function which is in a pre-loaded C library. The function can be called by giving the function name and the arguments as an input to the callib command.

6. What is the working of the following command?

libfunctions()

a) Returns the pre-loaded libraries
b) Returns the libraries in a pre-loaded library
c) Returns the header-files in a pre-loaded C library
d) Returns the functions in a pre-loaded library
Answer: d
Explanation: The above command returns the functions, in a library- the library name is given as an input to the command. The library is to be pre-loaded with the loadlibrary() command.

7. What is the working of the following command?

libfunctions(libname,'-full')

a) Returns the functions of a shared library
b) Returns the functions of a shared library and it’s signatures
c) Returns the signatures of the functions of a shared library
d) Error
Answer: b
Explanation: The above command returns both the set of functions present in the shared C library and the signature of each function in the pre-loaded library.

8. What is the working of the following command?

libfunctionsview

a) Displays the signatures of the function in an image window
b) Displays the signature of the functions in a graphical window
c) Displays the signature of the functions in the workspace window
d) Displays the signature of the function in a separate window
Answer: d
Explanation: The above command returns the signatures of the functions present in a library. The library name is given as an input to the command.

9. The libfunctionsview command shows the signature of the functions present in the ___________
a) pre-loaded library
b) any library
c) Java library
d) Not present
Answer: a
Explanation: The libfunctionsview command works only on a library that has been pre-loaded into MATLAB with the loadlbrary() command.

10. What is the working of the following command?

libisloaded()

a) Checks the version of the loaded library
b) Checks whether a library is working in the system
c) Checks whether a library is loaded in the system
d) Checks whether a library is present in the system
Answer: c
Explanation: The above command returns a 1 if it finds that the library, given as an input to the command, is pre-loaded in the system.

11. Which of the following command unloads a library from the system?
a) unldlibrary()
b) unloadlibrary()
c) unloadlibrary{}
d) unldlibrary[]
Answer: b
Explanation: The correct command to unload a library is unloadlibrary(). It is syntactically correct and no misspelling.

12. The isjava command returns?
a) 1 if the input is a java file
b) 1 if the input is not a java object
c) 1 if the input is a java object
d) 0 if the input is a java object
Answer: c
Explanation: The isjava command will return a 1 if the input to the command is a java object. It would return a 0 otherwise.

13. The input to the isjava command is given within _________
a) ()
b) []
c) {}
d) Doesn’t exist
Answer: a
Explanation: The input to the isjava command should be given within parentheses. It would return an error otherwise.

14. The isobject(A) returns a 1 if the _________
a) A is a MATLAB class
b) A is a JAVA class
c) A is a C file
d) A is not a MATLAB class
Answer: a
Explanation: The above command checks if the input given to it belongs to the MATLAB class. If it’s so, it’ll return a 1- else it’ll return a 0.

15. Python files cannot be used in MATLAB.
a) True
b) False
Answer: b
Explanation: Python files can be used in MATLAB. Python commands cannot run in MATLAB without Python in the system.

16. Python commands can be run in MATLAB without Python in the system.
a) True
b) False
Answer: b
Explanation: A version of C python is required to be present in the system for python commands to run. Hence, the above statement is false.

Toolbox Distribution – 1

1. What is the extension of a newly created toolbox?
a) .mltbx
b) .mlx
c) .tlx
d) .tbx
Answer: a
Explanation: A MATLAB Toolbox has the extension .mltbx. This is created when we produce a toolbox which is defined by the user.

2. What does the following function do?

matlab.addons.toolbox.packageToolbox

a) Converts a .prj file to a .mltbx file
b) Converts a .mat file to a .mltbx file
c) Converts a .mltbx file to a .prj file
d) Converts a .mltbx file to a .prj file
Answer: a
Explanation: The above function is defined in MATLAB to convert a user-defined toolbox into a installation file which can be used by other people to use your toolbox. The extension of this installation file is .mltbx.

3. What does the following function do?

matlab.addons.toolbox.toolboxVersion

a) Shows all versions of a toolbox
b) Shows the current version of a toolbox
c) Shows the previous versions of a toolbox
d) Error
Answer: b
Explanation: The above function is used to get the version of the toolbox which will be given as an input to the above function. It doesn’t show the previously installed versions or the versions which are possibly present.

4. The input to the function “matlab.addons.toolbox.toolboxVersion” is given within ______
a) Parentheses
b) {}
c) []
d) The function doesn’t exist
Answer: a
Explanation: The input to this function is given within parentheses. This is pre-defined in MATLAB and hence, only option Parentheses is correct.

5. What does this function do?

matlab.addons.toolbox.installToolbox

a) Install a .mlx file
b) Install a .mtbx file
c) Install a .mltbx file
d) Install a .tbx file
Answer: c
Explanation: The above function installs a toolbox into a system. Since a toolbox is a .mltbx file, only option Install a .mltbx file is correct.

6. License arguments for installing toolboxes are _______
a) Ignored
b) Shown
c) Do not exist
d) Depends on the system
Answer: b
Explanation: Irrespective of the system, a toolbox has a license agreement within it- it will be prompted during installation.

7. What is the output of the following code?

matlab.addons.toolbox.installToolbox(‘Lo.mltbx)

a) Installs the Lo class into the directory
b) Uninstalls the Lo class from the directory
c) Uninstalls the Lo toolbox from the directory, if already present
d) Installs the Lo toolbox into the directory
Answer: d
Explanation: The above function installs a toolbox into the system. The toolbox should be present in the current directory.

8. What is the output of the following code?

matlab.addons.toolbox.installToolbox[‘Lo.mltbx]

a) Error due to a directory
b) Installs the Lo toolbox into the directory
c) Logical Error
d) Syntactical error
Answer: d
Explanation: The input to the matlab.addons.toolbox.installToolbox command should be within parentheses. Here, [] is used which results in a syntactical error. It would’ve been a secondary error which won’t be checked even if it happens since the syntactical error will return the control.

9. What is the output of the following code?

matlab.addons.toolbox.installToolbox(Lo.mltbx,True)

a) Error
b) Ignores license file and installs the toolbox directly
c) Prompts the license file and installs the toolbox
d) Logical error
Answer: a
Explanation: The name of the toolbox file, given as an input to the command, is not given within ‘’. Hence, it’s not recognized as a file name and MATLAB returns an error.

Toolbox Distribution – 2

1. What does the function matlab.addons.toolbox.installedToolboxes return?
a) A structure
b) A table
c) A structure of arrays
d) An array of structure
Answer: c
Explanation: The above command returns a structure of arrays which are the Name, Version and Guide of the toolboxes installed in the system. It can be converted to array form and then viewed properly.

 

SIMULINK AND GUIS MCQs

 

2. What is the output of the following code?

ver Simulink

a) Shows the version of MATLAB
b) Shows the version of MATLAB and the Simulink Toolbox
c) Shows the version of the Simulink Toolbox
d) Shows the contents of Simulink Toolbox
Answer: b
Explanation: The ver function along with the name of a toolbox returns the version of the installed MATLAB version and the version of the toolbox.

3. What is the output of the above code?

ver Simulink Toolbox

a) Error
b) Shows the version of MATLAB
c) Shows the version of MATLAB and the Simulink Toolbox
d) Shows the version of the Simulink Toolbox
Answer: a
Explanation: The name of the toolbox is Simulink only. Hence, Toolbox written in the above code is an excess input and the output results in an error. The output would’ve been shows the version of MATLAB and the simulink toolbox if only Simulink was written.

4. A .mltbx toolbox is written in Java.
a) True
b) False
Answer: b
Explanation: A .mltbx toolbox is a toolbox which is written in the MATLAB environment only. Hence, the above statement is false.

5. A toolbox is same as a function.
a) True
b) False
Answer: b
Explanation: A toolbox has a multitude of function. It itself is not a function. It can be thought of as a header file.

6. What is the output of the following code?

matlab.addons.toolbox.uninstallToolbox[]

a) Error
b) Uninstalls the toolbox given in the input
c) Uninstalls all the toolboxes
d) Uninstalls the function given in the input
Answer: a
Explanation: The input to the above command is to be given within parentheses. If the input is given in the syntax shown above, it’ll result in an error.

7. What is the output of the following code?

matlab.addons.Toolbox.uninstalltoolbox()

a) Uninstalls the toolbox given in the input
b) Error
c) Uninstalls all the toolboxes in the system
d) Uninstalls the function given in the input
Answer: b
Explanation: There has been an error while spelling the command. It should be matlab.addons.toolbox.uninstallToolbox[], but it’s not so in the above code. Hence, this leads to an error.

8. What are the contents of the toolbox shown by the matlab.addons.toolbox.installedToolboxes command?
a) Name, Guid
b) Name, Version, Guid
c) Name, package, Guid
d) Name, package,
Answer: b
Explanation: The given command returns the properties of the installed toolbox, given by option name, version, guid. The guid is the toolbox identifier.

Performance and Memory – 1

1. The memory function is limited to _________
a) MS systems
b) Linux Systems
c) No system
d) Does not exist
Answer: a
Explanation: Typically, the memory function is present in MATLAB but is limited to the Microsoft Windows System. Hence, MS systems are correct.

2. What is p in the following code?

p=memory

a) A Structure of arrays
b) An array of structures
c) A stack
d) An array
Answer: a
Explanation: The function ‘memory’ returns 3 arrays, namely-
i. MaxPossibleArrayBytes
ii. MemAvailableAllArrays
iii.MemUsedMATLAB
And these are stored into p. So p is a structure of arrays.

3. When will the following be shown?

Limited by System Memory (physical + swap file) available.

a) In windows 64bit
b) In windows 32bit
c) In windows 64bit when mapping to a memory block is limited
d) In windows 32bit when mapping to a memory block is limited
Answer: c
Explanation: The above statement is shown in 64 bit systems. It is shown when there is insufficient memory in the system for mapping of all virtual addresses in the largest available block of the MATLAB process. Hence, Windows 64bit is correct option.

4. The memory used by MATLAB, shown in the output of the memory command, is ________
a) The total system memory allotted to MATLAB
b) The total physical memory allotted to MATLAB
c) The total space for only mathematical operations in MATLAB
d) The temporary storage allotted to MATLAB
Answer: a
Explanation: The memory function shows the total system memory allotted by MATLAB. It is the sum of the physical memory and potential swap file usage in the system.

5. What is the physical memory?

>>q.PhysicalMemory
ans = 
struct with fields:
        Available: 3.2158e+09
               Total: 8.5027e+09

a) RAM
b) Hard disk memory
c) ROM
d) Error
Answer: a
Explanation: The physical memory denotes the memory reserved in RAM for MATLAB. It can also be seen in the windows task manager. Hence, the correct answer is RAM.

6. Which of the following changes with time?

>>q.PhysicalMemory
ans = 
struct with fields:
        Available: 3.2158e+09
               Total: 8.5027e+09

a) Available Memory
b) Physical Memory
c) Available & Physical Memory
d) One at a time
Answer: a
Explanation: The physical memory denotes the RAM of the system where MATLAB is running. Hence, it doesn’t change but the available memory allotted to MATLAB changes.

7. Which of the following contains the system memory?

[p,q]=memory

a) p
b) q
c) It’s not returned
d) Error
Answer: b
Explanation: The system memory is stored in the structure q. Information regarding the system is returned as a second output by the memory command. So q is correct.

8. Which of the following contains the Physical Memory of the system only?

[p,q]=memory

a) p
b) q
c) It’s not returned
d) Syntactical error
Answer: b
Explanation: The physical memory of the system is an information regarding the system. That information are returned after the information regarding MATLAB is returned. Hence, they go to q.

9. Which of the following contains the memory used by MATLAB?

[p,q]=memory

a) p
b) q
c) It’s not returned
d) Error
Answer: a
Explanation: The memory command returns information regarding MATLAB prior to the system information and so the memory used by MATLAB is returned first. It’ll go to p and the correct option is p.

10. Which of the following contains the memory for the maximum possible array that can be made in MATLAB?

[p,q]=memory

a) q
b) p
c) It’s not returned
d) Error
Answer: b
Explanation: The memory command returns information regarding MATLAB prior to the system information and so the memory used by MATLAB is returned first. The maximum possible array is information regarding MATLAB and it’ll go to p and the correct option is p.

Performance and Memory – 2

1. Which of the following contains the memory for the virtual address space given to MATLAB?

[p,q]=memory

a) Error
b) p
c) There’s no virtual space for MATLAB
d) q
Answer: d
Explanation: The amount of memory allotted to the Virtual Address Space of MATLAB is given as an array to q. Hence, q is correct.

2. The function handle given to the timeit command cannot be defined within the timeit function.
a) True
b) False
Answer: b
Explanation: The function handle can be given as an input to the timeit() command. It’s not necessary that we need a separate variable to declare a function handle.

3. The timeit function returns the time in ms.
a) True
b) False
Answer: a
Explanation: The timeit function returns the time in seconds. Hence, the above statement is false.

 

MATLAB Programming MCCQs

 

4. What is the output of the following code?

syms x;
timeit(@()sin(x))

a) The time required to compute the value of a sin(x)
b) Error due to sin(x)
c) Syntactical Error
d) Time required to initialize sin(x) as a vector of symbolic elements
Answer: d
Explanation: Since x is declared as symbolic, the function sin(x) will only initialize itself as sin(x), It doesn’t compute a specific value and hence the time required for initializing sin(x) as a vector of symbolic elements is correct.

5. What is the output of the following code?

syms x;
timeit(@sin(x))

a) Syntactical Error
b) Logical Error
c) .0012
d) .0016
Answer: a
Explanation: The function handle has been declared with an error. A set of parentheses is missing. TH e function handle is defined as @()sin(x). Hence, the above code will give an error.

6. Which of the following method increases the performance of operation?
a) Preallocation
b) Postallocation
c) It’s not possible to increase performance
d) Characterization
Answer: a
Explanation: The method of preallocation helps in increasing the performance of memory. It can be used to specifically increase the speed of the operation.

7. Is a==c?

>>a=timeit(@()sin(x));
>>b=cputime;
>>sin(x);
>>c=cputime-b;

a) No
b) Yes
c) Almost
d) Error
Answer: a
Explanation: The time calculated and assigned to c is usually more than that in a. This is because the cpu time increases in the third statement only. Hence the option, which says that a is not equal to c is correct.

8. What is the output of the following code?

a=timeit(()sin(x));

a) Error
b) .0012s
c) 12ms
d) .0016s
Answer: a
Explanation: There is an error in the above code. The function handle has been wrongly decalred since the ‘@’ is missing. Hence the option, which says there will be an error, is correct.

9. The amount of memory saved for swap files is more than the physical memory allotted for MATLAB.
a) True
b) False
Answer: b
Explanation: The latter is always greater than the former. This is because the physical memory is getting used up during operations.

10. The tick command starts a timer.
a) True
b) False
Answer: b
Explanation: The command is misspelled. The correct command is tic only. Hence, the above statement is false.

System Commands – 1

1. The clipboard function cannot work without
a) Python
b) C
c) JAVA
d) Not present in MATLAB
Answer: c
Explanation: The command has been designed in MATLAB such that it won’t work in a system where the JAVA Oracle software is not present. Hence, the only correct option is JAVA.

2. What is the output of the following code?

clipboard('copy',poe)

a) Logical Error
b) Copies ‘poe’
c) Copies poe
d) Syntactical Error
Answer: d
Explanation: There is syntactical error in the following code. Since ‘poe’ is a string, it has to be declared within a pair of single inverted commas. Here it hasn’t been so which leads to an error and the correct answer is that there is a logical error.

3. What is the output of the following code?

clipboard(copy,’poe’)

a) Error
b) Copies poe
c) Copies poe to the MATLAB file
d) Copies poe to the MATLAB function
Answer: a
Explanation: ‘copy’ is a parameter passed to the function clipboard. It is a string so it should be enclosed within ‘’. But here, copy has been passed to the function without any enclosement which will characterize it as a string. Hence, this leads to an error.

4. What is the output of the following code?

clipboard[‘copy’,poe]

a) Error
b) Copies poe to a mlx file
c) Copies poe to a mat file
d) Copies poe to a mltbx file
Answer: a
Explanation: The input to the clipboard command has to be within parentheses. Since the above input has been given within [], it leads to an error.

5. What is the output of the following code?

clipboard(‘copy’,’poe’)
clipboard(‘paste’)

a) Prints poe
b) Prints ‘poe’
c) Prints error
d) Function not present in MATLAB
Answer: b
Explanation: ‘poe’ is a stirng. Hence, it will be printed within ‘’. The correct option is that ‘poe’ will get printed.

6. What is the output of the following code?

system(cmd)

a) Starts Command Prompt
b) Starts Command Prompt in MATLAB
c) Starts Command Prompt in a separate window
d) Error
Answer: d
Explanation: The input to the system command is a command which can be run through the OS. But the input int the above code isn’t given within ‘’. It should be within ‘’. Hence, this leads to an error.

7. What is the output of the above code?

system(‘cmd’)

a) Error
b) Starts Command Prompt in MATLAB
c) Starts Command Prompt in a separate window
d) Error
Answer: b
Explanation: A separate window isn’t opened for the command prompt. It starts in MATLAB only. Thus the correct answer is that the Command Prompt starts in MATLAB.

8. What is the output of the following code?

system('cd')

a) Shows the current directory
b) Shows the directory where MATLAB is located
c) Error
d) The function doesn’t exist
Answer: b
Explanation: cd is an OS command. The system command runs OS commands which are supported by the System. If we type ‘cd’ in Command Prompt, we get to know the current directory i.e. the path in the system where our control is currently present. Hence, here also, the current directory is shown.

9. What is the output of the following code?

system['cd']

a) Error
b) Syntactical error
c) Logical Error
d) Opens command prompt
Answer: a
Explanation: The input to the above system command should be given within parentheses. Since it has been given within [], it leads to an error.

10. What is the output of the following code?

system('date')

a) Shows the date in your system
b) Shows the actual date
c) Shows the date when MATLAB was installed
d) Error
Answer: a
Explanation: The above command shows the date which is displayed in the system. If it’s not the actual date, the command cannot differentiate and it’ll show what’s in your system. This is similar to the working in Command prompt and hence the correct answer is that it shows the date, currently saved, in the system.

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
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
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
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
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
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.

6. All system commands take input within parentheses.
a) True
b) False
Answer: a
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 ___________
a) winqueryreg
b) winreg
c) windowsregistry
d) not possible
Answer: a
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
Answer: c
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.

Updated MATLAB MCQs – Advanced Software Development ( MATLAB ) MCQs