Geometric Mean The geometric mean of a set of positive numbers x 1 through x n ,
Fantastic news! We've Found the answer you've been seeking!
Question:
Geometric Mean The geometric mean of a set of positive numbers x 1 through x n , is defined as the nth root of the product of the numbers:
Write a MATLAB program that will accept an arbitrary number of positive input values and calculate both the arithmetic mean (i.e., the average) and the geometric mean of the numbers. Use a while loop to get the input values, and terminate the inputs when a user enters a negative number. Test your program by calculating the average and geometric mean of the four numbers 10, 5, 2, and 5.
Related Book For
Elementary Statistics A step by step approach
ISBN: 978-0073386102
8th edition
Authors: Allan Bluman
Posted Date: