Question
help me with this Matlab function! Notes: 1 It is your choice to determine how the indicator variable works, and there are quite a few
help me with this Matlab function!
Notes: 1 It is your choice to determine how the indicator variable works, and there are quite a few ways to approach it and set up the associated conditional statements. Note that the above two examples are for two differently written functions: One that uses strings for the indicator, and one that uses numbers. If you are interested in strings, you should look into using the strcmp function. 2Note that log(x) in MATLAB takes the natural log, and log10(x) takes log base 10. For more information on changing the base of a logarithm, look here
This is all I have
This mini-project rcquires you to crcate a MATLAB function that can perform various basic mathematical functions on two numbers. You should name your function netIDcalculator, where netID is your netID (as in aaal11). Your function should take three inputs in the following order: num1 -The first number in the calculation you want to perform. num2 - The second number in the calculation you want to perform indicator - A variable, that has a data type of your choice1, that the user will use to determine which operation to perform. You should note in a comment how you are implementing the indicator variable. Your function should be able to perform the following operations: numl + num2 (addition) - numl - num2 (subtraction) numl num2 (multiplication) numl / num2 (division) numl num2 (exponent) - 1ognum2num1 (log base num2 of numl) - return the larger of num1 and num2 return the smaller of num1 and num2 Note that every time this function is called, it should only perform ONE of these o user should be able to choose from any of the operations with each call using the indicator input. For example, if you were to use a string for your indicator input, the call of: result- aaa111calculator (5,10, subtract); Would store the value of-5 in the variable result. In another example, using a numerical variable for the indicator, and associating 6 with the logarithmic operation, a call of: result-aaalllcalculator (125, 5, 6) Would store the value of 3 in the variable result perations. However, thStep 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