Frequently, functions are defined over the range of variables. An example of such piecewise function is the following:
There are different ways of defining this function. One way is to use if-then-else statement and determine the range of x. However, for large matrices this method is not so efficient. Write a vectorized implementation of this function f(x).
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here