Question: In this problem, you will create a user-defined logical function. Create a function named myLogic with: Four inputs: G , O , A , and
In this problem, you will create a user-defined logical function.
- Create a function named myLogic with:
- Four inputs: G, O, A, and L
- One output: finish
- Create a logical variable called R that determines if G is greater than L.
- Create a logical variable called S that determines if A is less than or equal to G.
- Create a logical variable called T that determines if O is not equal to A.
- Create a logical variable called U that calculates S and not(T or R).
- Determine the value of U:
- if U is true, finish=7GO+Afinish=7GO+A
- if U is false, finish=2Lfinish=2L
- Display finish using fprintf using a precision field of 5.
Using Matlab
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
