Question: c) Write a function named mm = myMean(x,id) that calls myGeomean and myHarmmean. If id = 1, it will return the geometric mean of the

 c) Write a function named mm = myMean(x,id) that calls myGeomean

c) Write a function named mm = myMean(x,id) that calls myGeomean and myHarmmean. If id = 1, it will return the geometric mean of the positive numbers of x in mm, if id = 2, it will return the harmonic mean of positive numbers of x in mm, and it will return -1 in mm for any other value of id. Verify your function one vector of your choice (with a length n > 5, and the vector must include negative elements) with three different values of id 1, 2, 3, and print your results

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!