# 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

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

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

3. When will the following be shown?

Take MATLAB Practice Tests - Chapterwise!
Start the Test Now: Chapter 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
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

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

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

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

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

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

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

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

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.