Performance and Memory

Uncategorized

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

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

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

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

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

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

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

7. Which of the following contains the system memory?

[p,q]=memory

a) p
b) q
c) It’s not returned
d) Error

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

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

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

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

12. The function handle given to the timeit command cannot be defined within the timeit function.
a) True
b) False

13. The timeit function returns the time in ms.
a) True
b) False

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

15. What is the output of the following code?

syms x;
timeit(@sin(x))

a) Syntactical Error
b) Logical Error
c) .0012
d) .0016

16. Which of the following method increases the performance of operation?
a) Preallocation
b) Postallocation
c) It’s not possible to increase performance
d) Characterization

17. Is a==c?

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

a) No
b) Yes
c) Almost
d) Error

18. What is the output of the following code?

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

a) Error
b) .0012s
c) 12ms
d) .0016s

19. The amount of memory saved for swap files is more than the physical memory allotted for MATLAB.
a) True
b) False

20. The tick command starts a timer.
a) True
b) False

Leave a Reply

Your email address will not be published. Required fields are marked *