For Questions 14 through 18, use the following answers:
a. Scalar
b. Local
c. Element
d. Index
e. Global
14. Position in an array.
15. Individual value in an array.
16. Type of variable that only contains one value at any given time.
17. A variable that is defined to be used or referenced by all m-files and functions.
18. A variable that is defined to only be used within its own m-file, not other files or fun
For Questions 19 and 20, analyze the following code:
function p = newPoint(x, y, z)
p = x + y + z^2;
fprintf('%d, %d, %d', x, y, z);
fprintf('%d', p);
If a main program calls the function as follows:
x = 3;
y = 2;
z = 1;
point = newPoint(z, y, x);
19. What values are printed for x, y, z in the function?
a. 321
b. 123
c. 231
d. 213
20. What value is printed for p in the function?
a. 36
b. 6
c. 12
d. none of the above