Here is the processed document with the code block restored and formatted:
Answer on Question #45477, Programming, Mat LAB | Mathematica | MathCAD | Maple
Question:
Matlab: Write a single program that calculates the arithmetic mean (average), rms average, geometric mean and harmonic mean for a set of n positive numbers. Your program should take two values xlow and xhigh and generate 10000 random numbers in the range [xlow...xhigh], and should print out arithmetic mean (average), rms average, geometric mean and harmonic mean.
Answer:
File average_values.m:
function [] = average_values(xlow, xhigh)
random_numbers = random('unif', xlow, xhigh, 10000, 1);
arithmetic_mean = mean(random_numbers);
rms_average = rms(random_numbers);
geometric_mean = geomean(random_numbers);
harmonic_mean = harmmean(random_numbers);
endhttp://www.AssignmentExpert.com/
Comments