or: Lb hursday l 0:hursday 2:30pm) Name : Charle Gala ile 4iu ID#: li A. (30%) T
ID: 1867405 • Letter: O
Question
or: Lb hursday l 0:hursday 2:30pm) Name : Charle Gala ile 4iu ID#: li A. (30%) True/False Questions (write "T" or "F"): (Each question is 1 point.) (2.A MATLAB variable name must begin with a letter or a number, followed by any combination of (3. The logical OR operator gives true only if both statements are true. ( 4. The Matlab code for the equation could bei 1.5(dy) ( ) 5. When we execute the code: a [-5, 5, 9); logical(a), we obtain the answer: ans-[1,1,1] (1. The answer of Matlab code 244/2+5 is 9 letters, numbers, and the underscore character. 6. The result of executing ceil(11/5)+6 is 8. 7. The command "subplot(3,2,4)" will divide the current figure into 8 regions arranged in two row: and four columns and plot the graph on the third region. ) 8. a-true; b=-5; a +-b The result is true(1) ) 9. a-false; b#6; a l-b The result is true(1) ) 10. If we use for i = [1 2:4 51, the for-loop statement will be executed 4 times. ) 11. If str1 = 'MATLAB' and str2+·Matlab', then strcmp(stri, str2) returns a 1. ) 12. Ifstri = 'hello' and str2 = 'HEllo", then the answer of stri-= str2 is 1 1 0 0 0 ) 13. Let c-3-4i. When MATLAB imag(c) is entered, it will generate 4. ) 14. The function pie can add an optional parameter that is the explode control to separate individua pie slices from the remainder of the pie. ) 15. The command course rCs101'; 'MATLAB] will generate an error message. ) 16. MATLAB can represent a data array of more than 3 dimensions. ) 17. The name of a program file must be the same as the defined main function's name in the prog If it is different, then executing the file will cause an error. ) 18. Let a-'CS 101'; since there are 5 characters, the size of"a"in Matlab ?s 5 bytes. 19. Let a 8; the size of the variable "a" in Matlab is 8 bytes ) 20. In a try/catch construct, if there is an error in the try block, the statements in the catch blo will be skipped. )21. A function called "test.m" consists of two lines of Matlab code. The first line is "function t and the second line is "d-12;" After calling this function by tying "test" in the command wind we then type "d". At this time, the answer for d is 12. )22. A cell array is a special MATLAB array whose elements are cells, containers that can hold MATLAB arrays. )23. In a cell array, one cell might contain an array of real number, another an array of strings, another a vector of complex numbers.Explanation / Answer
1. False. The expression yields 13
2. False. A variable name must start with a letter.
3. False. Any one or both of the statements need to be true for the OR to evaluate to true.
4. True
5. True.
6. False. The result is 9.
7. False. It divides the plot region into 6 parts - 3 rows and 2 columns and returns the axes of the 4th region from the beginning.
8. False. The result is 6.
9. True
10. False. It executes 2 times.
11. False. It returns 0.
12. True
13. False. It generates -4.
14. True.
15. False
16. True
17. True. If it is a function file, then the name of the file must be same as the name of the function
18. True
19. True
20. False. The control shifts to the catch block which then executes the statements which should be executed upon getting the error/exception.
21. False.
22. True.
23. True.
I hope this exercise is easy. Please try yourself on MATLAB for better practice. Please rate.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.