This preview shows page 1. Sign up to view the full content.
Unformatted text preview: b. Write another version of the function that takes in a scalar x input and outputs the corresponding scalar f(x) . The function must be constructed using an explicit ifelseifelseend construction. Use this function to evaluate and plot f(x) over the same range of x s as in part (a). 4. Consider the relational operation: k = (a < b); where a is a realvalued row vector and b is either a realvalued row vector of the same length as a , or, a scalar. Write a MATLAB function, k = f(a,b); that implements the same relational operation using forloops and ifstatements only. The output k must be of type logical . Test it on the two cases: a = [1 2 0 3 7]; b = [3 2 4 1 7]; a = [1 2 0 3 7]; b = 3; 5. If time permits, do Practice Exercise 9.1 and 9.2 from Ch.9. 1...
View
Full
Document
 Spring '11
 Orfandi

Click to edit the document details