CS 103 Test 41 (the rest of Test 4) Fall 2009 Problem 1. (15 points) Enter answers to this problem into the function t4 p1 (in the provided M-file t4 p1.m ). A. The break statement is used to 1. terminate a loop 2. terminate a for loop but not a while loop 3. terminate a while loop but not a for loop 4. terminate a function B. The default scope in Matlab is 1. local for variables used in the body of a function but global for its formal parameters 2. global for variables used in the body of a function but local for its formal parameters 3. global both for variables used in the body of a function and for its formal parameters 4. local both for variables used in the body of a function and for its formal parameters C. If foo.m contains a primary function called foo and two subfunctions nick and ken , then nick can be called 1. only from within foo 2. from within foo or ken 3. only from within ken 4. only from within the Command Window D. The following commands are given: list(4).drink = 'milk'; list(4).sandwich = 'ham';
This is the end of the preview. Sign up
access the rest of the document.
This note was uploaded on 12/12/2009 for the course CS CS 103 taught by Professor Fitzpatrick during the Spring '09 term at Vanderbilt.