Question
c) Write a function named mm = myMean (x, id) that calls myGeomean and my Harmmean. If id = 1, it will return the
c) Write a function named mm = myMean (x, id) that calls myGeomean and my Harmmean. 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
3.50 Rating (160 Votes )
There are 3 Steps involved in it
Step: 1
function mm myMeanx id Check if id is 1 or 2 if id 1 Calculate geometric mean of positive number...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 StartedRecommended Textbook for
Linear Algebra
Authors: Jim Hefferon
1st Edition
978-0982406212, 0982406215
Students also viewed these Programming questions
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
View Answer in SolutionInn App