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!
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 endStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started