MATLAB - Function M-Files
Hi guys i'm new to this software package and require some assistance on making 2 function M-files...
1)Write a function file replace that replaces all elements in a row vector that are between -2 and +2 by 0. The function file should operate on row vectors of arbitrary length. You are not allowed to use the Matlab function find.
Hints: Use a for loop and an if statement. The length of a row vector x can be
obtained using the Matlab command length(x).
2) Write a function file FindPositive that takes in a row vector of arbitrary length and returns the first positive value in the row vector, as well as the index of the row vector where the first positive value occurred. You are not allowed to use a for loop or an if statement in your solution.