1. Multiple choice. Each question is worth I points. There is only one correct answer in each question. [10 In the current orkspace, there are four variables: a,b,c,d, you want to remove these variables from current workspace, the correct command is A) clear a bed: B) clear a, b, c, d: C) clear a; b; e: d: D) ckar a: b: c d: 2) Which follow ing statement is wrong? A) File name are case sensitive B) File name must begins with letter C) File name can contains letters, digits,space and underscores. D) The keywords can not he used as file name 3) is not characters in MATLAB A) "2 B) C) T D) X E) '2 4) In the command window, a string variable is created as shown below i-sprintE'My string is: 5d, 3d 55, 3) >length(l) What is the outpat after you evaluate above commands? A) 21 B) 22 C 23 Di 24 3,15 1 5) There are two stings, s1 LXYZU and s2-LUVWL. Symbol u indicates a space. You want to concatenate sl and s2 to new string s in the form of LXYZUUVW. Which of the following command is correct? C)stroat(1 2) D) >>trcat(al, 2) 6) Which of the following statement is not true? A) Local variable exists within the local workspace when a function is called. B) Persistent variable is only known to the function in which it been declared. C) Persistent variable can added to base workspace once it has been declared D) The value of global variable can be accessed by any function which has declared it as global variable. 7) A function callros (3) will produce which of the following? A) 0 0 0 B) 0 Co0 0 D) None of above 15 APITEC2600 A Fall 2015 8) Consider the function xyz: funetion 11 E(xys) output 9 end What will be in out after the commandut (3)? A) 9 ) C) NaN D) Error 9) Which of the following statement is not true? A) If the global variable does not exist the first time you issue the global statement, it is initialized to the empty matrix. B) The names of global variables must be capitalized. C) Global variables can be shared by more than one function. D) The global declaration must occur before the variable is actually used in a func- tion. 10) What is the output of>(firat, rest rtok ( HHello, World? A) first- Hello, World rest Empty string: 1-by-0 B) first Hello, rest World C) first ello, World rest Empty string: 1-by-0 D) first - ello, rest World E) first Hello rest World 2. Use colon operator to create a column vector v given below. What is the size of v? What is the length of v? [4] 14 3. Dealing with blanks. Symbol u indicates a space. (a) Given a string s XXYYzzuuuuuvvww', how can you remove all the blanks in the middle of the string s? [3] (b) Given a string phrase 'Hello, Land uhow iareLi you Lidoing Litoday?, how can you find how many blanks there are in a string phrase ? 13 6 15 4. In the command window, the following commands are typed >>a3- "Gone with the Mind'; 4The Shawshank Do the follow ing questions. Use symbol u as a space. (a) Write out the content of mystring.mat. If there is a space, use symbol L 4] (b) What is the output of ise yatring at) ?12 (c) What is the output of stringma(3,7) 711 (d) what is the output of,rt ring-nat (2:3, gas) ? 131 2