Given an array of n elements we need to find the geometric mean of the numbers. If X is a matrix then geomean X is a row vector containing the geometric mean of each column of X. The formula for calculating the geometric mean is.
Also you probably meant something like this for your if-test.
I am trying to create a code that will accept inputs until a negative integer is entered then take all the positive integers as a vector and calculate the geometric mean and average. From your data table click the Analyze button and select Column Statistics. An alternative way to write the formula is X1 x X2. X geomeana x 168519.