Question: 1. m 2. Write a function with header [f] = myMultOperation(a,b,oper- ation). The input argument, oper- ation, is a string that is either plus', 'minus',

 1. m 2. Write a function with header [f] = myMultOperation(a,b,oper-
ation). The input argument, oper- ation, is a string that is either

1. m 2. Write a function with header [f] = myMultOperation(a,b,oper- ation). The input argument, oper- ation, is a string that is either plus', 'minus', 'mult', 'div', or 'pow', and f should be computed as a+b, a-b, a*b, a/b, and ab for the respective values for operation. Be sure to make your function vectorized. Hint: Use the strcmp function. Test Cases: Page 75 of 299 31% >> x = [1 2 3 4]; >> y = [2 3 4 5); >> f = myMultOperation (x, y, 'plus') 3 5 7 9 >> f = myMultOperation (x, y, 'minus') f = - -1 -1 -1 -1 >> f = myMultOperation (x, y, 'mult') f = 2 6 12 20 >> f = myMultOperation (x, y, 'div') 0.8000 0.5000 0.6667 0.7500 >> f = myMultOperation (x, y, 'pow') f = 1024

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!