REFRESHER MATH LAB
1. MATLAB stands for? A. matrix laboratory B. math library C.matrix library D.matrix library
a
25. 14. What is the value of ans that is printed when the following code is run: isnumeric(32) A. 1 B. yes C. o D. true
a
27. To add a comment to the mfile. the MATLAB command is A. % B. ; C. comment(**) D. &
a
3. To determine whether an input is a MATLAB keyword, command is? A. iskeyword C. keyword B. inputword D. isvarname
a
31. The cle command is used to A. clear the command window B. erase everything in the mfile C. clean the desktop D. save the existing mile
a
32. The num2str command A. converts a number to string B. converts string to a number C. concatenates numbers and strings D. concatenates strings
a
33. To join one or more strings into a single string is Known as A. concatenation C. string conversion B. joining D. string theory
a
34. The output of the last line is aa=2 as=num2str(aa) cat=['cat' as] A. cat2 C. ??? Undefined function or variable 'as' C. cat 2 D) cat aa
a
35. The output of cat=['cat' 'dog'] A. catdog B. cat dog C. cat&dog D. CatDog
a
36. How would you plot multiple graphs in MATLAB? A. Using the hold function B. Using the mplot function C. Using the mstem function D. It cannot be done in MATLAB
a
38. The help command works only for a pre-defined function in MATLAB I. True II. False A. I only B. Both I & II C. Il only D. None of the above
a
40. It is not possible to store graphs as MAT-file. A. True B. False
a
41. The command used to reflect the files from a disk into the workspace is A. load B. show C. disp() D. it is not possible
a
42. The format for 5 digit representation along with exponent is A. short e B. short g C. short exp D. 4 digit along with exponent value can be represented
a
44. The function to plot a graph with both axes on logarithmic scales is A. loglog B. log C. semilog D. not possible
a
46. What is the command used to clear all variables from the workspace in MATLAB? A. clearvars B. clear C. delete D. remove
a
47. Which MATLAB function is used to calculate the absolute value of a number? A. abs B. round C. ceil D. floor
a
49. How can you check the size of a matrix in MATLAB? A. size() B. length() C. dimensions() D. shape()
a
50. Which command is used to generate a sequence of evenly spaced values in MATLAB? A. linspace B. sequence C. range D. generate
a
52. Which command is used to calculate the dot product of two vectors in MATLAB? A. dot B. product C. multiply D. cross
a
53. How do you access the element in the second row and third column of a matrix called "A" in MATLAB? A. A(2,3) B. A{2,3} C. A(2](3] D. A[2,3]
a
54. Which command is used to find the maximum value in an array in MATLAB? A. max B. largest C. maximum D. peak
a
55. What is the output of the following MATLAB code? A = [1 2 3: 4 5 6: 7 8 91: B = A(:, 2); disp(B); A. [2 5 8] B. [1 2 3] C. [2; 5; 8] D. [4 5 6]
a
60. Which character is used to print new line in a printf statement? A. /n B. /n! C. /nml D. /nxt
a
62. Keys combition used to stop execution of a command in MATLAB? A. ctri+c B. ctrit+s C. ctri+b D. ctr|+enter
a
64. Which of the following is a switch-case structure? A. Logical structure B. Conditional structure C. Hierarchical structure D. Multidimensional structure
a
66. The continue statement exits the current iteration In nested loops. 1. True 11.false A. I only B. Both I & II C. Il only D. None of the above
a
7. To stop the execution of a MATLAB command, use keys? A. ctr+c B. ctri+b C. ctri+s D. ctrI+enter
a
72. Based on the code below, c is the___of a a = rand(1, 11); b = sort(a); c = b(1, ceil(end/2)) A. median B. mode C. mean D. margin
a
73. What does the Profiler track? A. execution time B. errors C. command history D. the value of variables
a
79. For which of these arrays do mean, median, and mode return the same value? A. [0 1 1 1 2] B. [1 3 5 5 61 C. (01 1 1 1) D. (0 0 5 5 5]
a
81. What built-in definition does i have? A. basic imaginary unit B. index function C. infinity D. index variable
a
9. How to end the MATLAB software? A. Type "Exit" B. Type "End" C. Type "ESC" D. Another method is used
a
You sent 51. What does the "disp" function do in MATLAB? A. Display the contents of a variable. B. Calculate the exponential value. C. Round a number to the nearest integer. D. Perform element-wise division.
a
15. This Matlab command clears all data and variables stored in memory: A. cle B. clear C. delete D. deallocate
b
2. Which command is used to clear a command window? A. clear B. clc C close all D. clear all
b
29. When used in the fprintf command, the In is used to A. add a space between any two characters B. add a line space (enter key) C. place a number into the comment D. clear the comment
b
45. We cannot plot a discrete and continuous relationship in the same graph. A. True B. False
b
5. Command is used to save command window text to file. A. saveas B. diary C. texttofile D. todiary
b
56. Index of an array in MATLAB start with A. 0 B. 1 C. Depends on the class of array D. Unknown
b
61. What is output of A = [1 0 2]; b = [3 0 7]; c=a.'b; A. 2 0 211 B. [3 0 14] C. (14 0 3) D. 17 0 31
b
63. Which class is used in Matlab to store the complex number? A. Double C. character B. symbolic D. array
b
65. Which of the following is a Assignment operator in matlab? A '+' B. '=' D. '*'
b
69. When was MATLAB 9.7 R2019b released? A. May 2019 B. Sep 2019 C. Aug 2019 D. July 2019
b
70. Which of the following command lists the current variable in Matlab? A. Type B. Who C. Pwd D. Date
b
77. You have written a function myfun and want to measure how long it takes to run. Which code segment will return in t the time in seconds it takes myfun to run? A..t = cutime(myfun()); C..t = timer(myfun()); B.. tic; myfun(); toc; D.. timer.start: myfun() t = timer.stop;
b
78. Which function could you use for multiple linear regression? A. polyval C. solve B. regress D. polyfit
b
8. Which is the invalid variable name in MATLAB? A. X6 B. 6x C. last D. z
b
80. How do you access the value for the field name in structure S? A. S['name] C. S('name) B. S.name D. S{'name")
b
83. Which statement is equivalent to this for loop? a = [1 2 3; 4 5 6]; b = zeros(size(a)); for i_row = 1:size(a, 1) for i col = 1:size(a. 2) C b(i_row, i_col) = a(i_row, i_col)^2; end end A.b= a*a; B. b = a.^2: C. b = a^2; D. b = pow2(a);
b
84. You have plotted values of cosine from - 10 to 10 and want to change the x-axis tick marks to every pi, from -3pi to 3pi. Which statement will do that? A. xticks(-3pi:3.14:3pi) B. xticks(-3pi:pi:3рі) C. xticks(linespace(-3pi(), 3рі(), pi())) D. xticks(linespace(-3pi, 3рі, рі)
b
88. What is true of a handle class object? A. When you pass a handle object to a function, a new object is made that is independent of the original. B. All copies of handle objects refer to the same underlying object. C. Handle object cannot reference one another. D. Handle object do not have a default eq function.
b
96. Which statement is true about the sparse matrices? A. You can use the sparse function to remove empty cells from cell array variables. B. Sparse matrices always use less memory than their associated full matrices. C. Mixtures of sparse and full matrices can be combined in all of MATLAB's built-in arithmetic operations. D. The sparse function requires its input to be a full matrix with at least 50% zero elements
b
You sent 18. Which is these is not an aspect of a for/while loop: A. update B. runner C. initialization D. condition
b
57. What is the return type of angles function in MATLAB? A. Degrees B. Radians C. Radians & Degrees D. Depends on the argument
b` 58. What is use of abs function in Matlab? A. returns the square root of number B. returns magnitude of a number C. returns power of number D. None of these`b
11. What is the storage in Matlab? A. Decimal B. Character C. Array D. Numeric
c
12. In Matlab, this keyword immediately moves to the next iteration of the loop: A. update B. goto C. continue D. break
c
13. Characters in Matlab are represented in their value in memory. A. decimal C. ASCII B. hex D. string
c
17. This Matlab command clears all data and variables stored in memory: A. cle B. delete C. clear D. deallocate
c
21. Which of the following will correctly define x, y, and z as symbols? A. sym (x, y, z) C. syms x y z B. syms x, y, z D. sym x, y, z
c
22.Which of these is the way to access the first element in a vector named v (assuming there is at least one element in the vector)? A. v(0) C. v(1) B. v D. v(:, o)
c
23.Which of the following is used to see if two elements are equal in MATLAB? A.!= B. isequal C. == D.=
c
26. If I want to save a formatted string to memory, but don't want to print it out, which command should I use? A. fprintf B. disp C. sprintf D. echo
c
30. To display 'Question 2' in the command window, the correct command is A. disp(Question 2) C. disp('Question 2') B. display('Question 2') D. Question 2
c
4. Command used to display the value of variable x. A. displayx B. disp x C. disp(x) D. vardisp(x)
c
43. Which operator is used to prevent the printing of insignificant zeros? A. %0 B. %nz C.%g D. It is not possible
c
59. What will be the output of atan2(-1,1) in Matlab? A. Error B. pi/4 C. 0.7854 C. 0
c
6. Executing in the editor window the following code returns. a = 1; sin(a) a = 2; A. 0.4815 B. 1 C. 0.8415 D. 0.9093
c
74. What is %% used for? A. argument placeholder B. block quotes C. code sections D. conversion specifier
c
75. what is the . character NOT used for? A. structure field access B. a decimal point C. cell array access D. element-wise operations
c
85. Which function CANNOT be used to randomly sample data? A. datasample C. resample B. randi D. randperm
c
90. Which statement could create this cell array?? C= ('hello world"]} (1x1 cell' {l"goodbye"]} {1x3 double) A. c=("hello world" ("hello") "goodbye" (1 2]): B. c = ("hello world" ("hello") "goodbye" ([1 2 3); C. c={"hello world" ("hello") "goodbye" [1 2 317]}; D. c={"hello world" ("hello" "hello") "goodbye" ([1 2 3]});
c
99. Which is NOT a function that adds text to a plot? A. title B. text C. label D. legend
c
You sent 82. You are in the middle of a long MATLAB session where you have performed many analyses and made many plots. You run the following commands, yet a figure window doesn't pop up on the top of your screen with your plot. What might be the issue? x = [-1:0.1:1]: y = X.^2; plot(x, y) A. Your plot doesn't plot in a figure window because figure was not called immediately in advance. B. Your plot syntax is incorrect. C. Your plot is in a figure window that was already open, hidden behind other windows on your screen. D. Your plot was saved to an image file but not displayed
c
10. Which of the following is not a predefined variable in Matlab A. pi B. inf C.i D. g
d
100. What kind of files are stored with the mat extension? A. figure files B. script files C. function files D. stored variable files
d
14. Which is these is not an aspect of for/while loop: A. condition B. initialization C update D. runner
d
16. What symbol precedes all comments in Matlab? A.% B. < C. // D. none of the above
d
19. To better manage memory and prevent unnecessary memory allocations, Matlab A. vectors B. matrix math C. scalars D. delayed copy
d
20. To print a newline in a fprintf statement, you must use the following escape character: A. /nl B. /t C. /nxt D. /n
d
24. If vector = [1 2 3 4; 11 24 92 100; 345 65 90 1]. What will the value of a be equal to if this code is entered into MATLAB >>(a b] = size (vector)? A. 1234 b. 4 C. 12 D. 3
d
28. When used in the fprintf command, the %g is used as the A. single character display B. fixed point display C. string notation display D. default number display
d
37.How do you show the program of an MAT file? A. The program should contain the echo command B. The program should contain the showprog command C. The program should contain the diary command D. The program cannot be shown while running a MEX file
d
39. What is the equivalent of subplot (1, 1, 1)? A. subplot B. plot C. It is not possible D. axes
d
48. Which command is used to display the contents of a file in the MATLAB command window? A. view B. show C. display D. load
d
67. Which of the following is the disadvantage of Matlab? A. Matlab is a fourth-generation high-level language B. Being compiler independent makes Matlab more efficient and productive C. Matlab codes are written in sentences and executed one by one D. Matlab is an interpreted language thus it can be very slow.
d
68. What are the features of Matlab? A. Full Graphics Capabilities B. Platform Independent C. Ease of Use & Good Source of Help D. All of the above
d
71. From what distribution does the rand() function return value? A normal C. poisson B. binomial D. uniform
d