Question: Use Python and import math. Translate the MATLAB Epiece.m function from the MATLAB Exam into Python. Write a function called PyPiece with two input
Use Python and import math. Translate the MATLAB "Epiece.m function from the MATLAB Exam into Python. Write a
function called "PyPiece" with two input arrays x and y with a variable number of array
elements and three outputs. If the input arrays are not the same length the function should
output an error message. The first output is an array determined by Table the second
output is the average of the output array and the third output is the index number of the
minimum value of x The function needs to check each y character and based on the
character, use the different equations listed in Table to compute the first output. Assume y
will only be an array of characters A and B Add comments so they are displayed as
function help explaining the inputs and outputs and include your name and assignment
heading. Ignore the differences in how functions are called and how outputs are displayed.
Table Function Used for First Output and Input Type
Function Test in
Command Window:
abc Epiece ABBA
a
b
c
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
