Make a function file of the following form:
Exercise 6.7: IF loops
function B = replace2(A)
in which all elements of a matrix greater than 5 are replaced by 0. Do this without using the command
(HINT 1: Use the commands
>> if and
(HINT 2: Take the function file from the previous exercise as starting point.)
- Work out the problem on paper.
- Write the m-file in MATLAB.
- Test the function file with the matrix [2 12;5 8] and, if necessary, debug the file.