Question: Problem 3 . [ 3 5 points ] Electricity bill. Write a MATLAB function called billCalculator that takes the monthly electricity unit usage of N

Problem 3.[35 points] Electricity bill. Write a MATLAB function called billCalculator that takes the monthly electricity unit usage of N families as an input vector x(the length of x is N), and returns a vector y that contains each family's total electricity bill based on the following table:
\table[[Electricity usage bracket,Rate],[usage 100,$0.45? unit],[100 usage 250,$0.85? unit],[Usage >250,$1.45? unit]]
*Note: an additional fixed customer charge of $12 is added to the total bill of each family.
Call the function and calculate the electricity bill for 5000 users with their usage stored in dat_hw11_prob3.mat. You must implement your solution in two ways: with loops and without loops. This means that you need to implement two functions one uses the loop, and one does not use any loop.
Submit your .m file as "yourLastName hw11 prob3.m" and report maximum. minimum, mean and variance of the monthly electricity costs derived from the data in the write-up.
Problem 3 . [ 3 5 points ] Electricity bill.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!