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.

  1. Create a function named myLogic with:
    • Four inputs: G, O, A, and L
    • One output: finish
  2. Create a logical variable called R that determines if G is greater than L.
  3. Create a logical variable called S that determines if A is less than or equal to G.
  4. Create a logical variable called T that determines if O is not equal to A.
  5. Create a logical variable called U that calculates S and not(T or R).
  6. Determine the value of U:
    • if U is true, finish=7GO+Afinish=7GO+A
    • if U is false, finish=2Lfinish=2L
  7. 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 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!