MATLAB Questions and Answers – Performance and Memory – 1

This set of MATLAB Multiple Choice Questions & Answers (MCQs) focuses on “Performance and Memory – 1”.

1. The memory function is limited to _________
a) MS systems
b) Linux Systems
c) No system
d) Does not exist
View Answer

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
View Answer

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

3. When will the following be shown?

Note: Join free Sanfoundry classes at Telegram or Youtube
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
View Answer

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

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
View Answer

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?

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

a) RAM
b) Hard disk memory
c) ROM
d) Error
View Answer

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
View Answer

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
View Answer

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
View Answer

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
View Answer

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
View Answer

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.

Sanfoundry Global Education & Learning Series – MATLAB.

To practice all areas of MATLAB, here is complete set of 1000+ Multiple Choice Questions and Answers.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). 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!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.