Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Monthly power consumption in Megawatts (MW) for a manufacturing plant for a year

ID: 1926759 • Letter: M

Question

Monthly power consumption in Megawatts (MW) for a manufacturing plant for a year is given by the following data: The average yearly power consumption. Print your result to 2 decimal places and compare your result to the MA TLAB mean function.

Explanation / Answer

P = [ 352.7, 279.3, 250.9, 186.1, 135.5, 159.9, 233.1, 297.7, 218.5, 216.4, 290.3, 370.0 ]; n = 12; P_max = 0; P_sum = 0; P_avg = 0; P_std = 0; max_month = 0; fprintf(' '); for i = 1:n if (P(i) > P_max) P_max = P(i); max_month = i; end P_sum = P_sum + P(i); end; P_avg = P_sum / n; fprintf('Calculated Averge: %6.2f ', P_avg); fprintf('MATLAB mean(): %6.2f ', mean(P)); fprintf(' '); for i = 1:n P_std = P_std + (P(i) - P_avg)^2; end; P_std = sqrt(P_std / (n-1)); fprintf('Calculated Standard Deviation: %6.3f ', P_std); fprintf('MATLAB std(): %6.3f ', std(P)); fprintf(' '); fprintf('MONTHLY POWER USE ABOVE THE YEARLY AVERAGE '); fprintf(' MONTH POWER USE (MW) '); for i = 1:n if (P(i) > P_avg) fprintf(' %3d %9.1f ',i,P(i)); end; end; fprintf(' '); fprintf('MAXIMUM MONTHLY POWER USE '); fprintf(' MONTH POWER USE (MW) '); fprintf(' %3d %9.1f ',max_month,P_max);

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote