Question: MATLAB Question!! Please Help! For this problem you will be asked to modify the function below as follows: Add an additional input argument (call it

MATLAB Question!! Please Help!MATLAB Question!! Please Help! For this problem you will be asked to

For this problem you will be asked to modify the function below as follows: Add an additional input argument (call it user_sel_in ) that will allow a user to enter an operation type (addition, subtraction for example). This will always be a numeric argument. If the user enters a 1, they mean to add, if the user enters a 2, they mean to subtract. Add an additional output argument (call it user_sel_out) that will allow you to return a string to the user, representing what they chose to do. For example, if the user enters a 1, you should return the string 'addition'. If the user enters a 2, you should always return the string 'subtraction'. In the function body, you should do the following: Based on what the user entered for the parameter that you created, you will either add up the first two parameters, or you will subtract the second parameter from the first. Example: first_arg - second_arg. You should return the answer in the output argument result, and you should indicate what the user chose in the output argument that you created, called user_sel_out.

Solution MATLAB Documentation 1%You need to modify this line by adding additional input and output arguments as described 2 function [result] function-example(array1, array2) 4 %Follow the instructions above to complete the body of this code 5 end

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!