View the step-by-step solution to:

Question

Ps: I need in matlab code please

The electricity accounts of residents in a very small rural community are calculated as follows:
If 500 or fewer units are used, the cost is 2 cents per unit.
&quot; If more than 500, but not more than 1000, units are used, the cost is \$10 for the first
500 units and 5 cents for every unit in excess of 500.
If more than 1000 units are used, the cost is \$35 for the first 1000 units plus
10 cents for every unit in excess of 1000.
A basic service fee of \$5 is charged no matter how much electricity is used.
Five residents use the following amounts (units) of electricity in a certain month: 200, 500, 700,
1000, and 1500.Write a program that uses logical vectors to calculate how much they must pay.
Display the results in two columns: one for the electricity used in each case and one for the amount
they should pay. Script name should be called electricityl.m

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

-

Educational Resources
• -

Study Documents

Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

Browse Documents