89 162
Assignments Done
98.1%
Successfully Done
In July 2020

# Answer to Question #45547 in MatLAB | Mathematica | MathCAD | Maple for VISHNUJITH

Question #45547
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.
The definitions of means are given as follows.
1
2014-09-03T04:21:34-0400
% Inputxlow = input(&#039;xlow: &#039;);xhigh = input(&#039;xhigh: &#039;); % Random arrayarray = randi([xlow xhigh], 1, 10000); % Arithmetic meanAM = mean(array); % Quadratic meanQM = sqrt(mean(array.^2));% Geometric meanGM = geomean(array);% Harmonic meanHM = harmmean(array); % Outputfprintf(&#039;Arithmetic mean: %.3f\n&#039;, AM);fprintf(&#039;Quadratic mean: %.3f\n&#039;, QM);fprintf(&#039;Geometric mean: %.3f\n&#039;, GM);fprintf(&#039;Harmonic mean: %.3f\n&#039;, HM);

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!