Question 5 Write Matlab Function Remove Two Input Parameters Vector S Value V Function Ret Q30285072

Question 5 (a) Write a MATLAB function remove that has two input parameters: a vector S, and a value V. The function returns another vector that is the result of removing every appearance of the value V from S. For example remove(hello, a) will return hello remove(heat, e) will return hat remove(teenager, e) will return tnagr [9 marks] (b) Will your code work if the parameters are integers instead of characters, i.e. will remove([1,2,3,4], 3) return [1,2,4]? Explain why or why not. [3 marks]

Question 5 (a) Write a MATLAB function remove that has two input parameters: a vector S, and a value V. The function returns another vector that is the result of removing every appearance of the value V from S. For example remove(hello’, ‘a) will return ‘hello’ remove(heat, ‘e’) will return ‘hat’ remove(teenager’, ‘e’) will return ‘tnagr’ [9 marks] (b) Will your code work if the parameters are integers instead of characters, i.e. will remove([1,2,3,4], 3) return [1,2,4]? Explain why or why not. [3 marks] Show transcribed image text

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *