Question

3. The electricity accounts of residents in a very small town are calculated as follows: e if 500 units or less are used the

Can you make matlab solve it?

0 0
Add a comment Improve this question Transcribed image text
Answer #1

MATLAB Code:

% Script that calculates the electricity bill

% Input vector
ipVec = [200, 500, 700, 1000, 1500];

% Iterating over each value
for i=1:5
% Getting value
units = ipVec(i);
  
% Set cost to 0 initially
cost = 0;
  
% Calculating bill
if units <= 500
cost = units * 0.02;
elseif units > 500 && units <= 1000
cost = 10 + ((units-500 * 0.05));
elseif units > 1000
cost = 35 + ((units-1000 * 0.10));
end   
  
% Adding service fee
cost = cost + 5;
  
% Printing results
fprintf("\n For %d units, ElectricBill is $%.2f \n", units, cost);
  
end % for end

_________________________________________________________________________________________________

Sample Run:

>>electricityBill For 200 units, ElectricBill is $9.00 For 500 units, ElectricBill is $15.00 For 700 units, ElectricBill is $

Add a comment
Know the answer?
Add Answer to:
Can you make matlab solve it? 3. The electricity accounts of residents in a very small...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • PROBLEM 3-13 Identifying Cost Behavior Pattern A number of graphs displaying cost behavior patterns are shown...

    PROBLEM 3-13 Identifying Cost Behavior Pattern A number of graphs displaying cost behavior patterns are shown below. The vertical axis on each graph represents total cost, and the horizontal axis represents level of activity (volume). Required: 1. For each of the following situations, identify the graph below that illustrates the cost behavior pattern involved. Any graph may be used more than once. Cost of raw materials used. Electricity billa flat fixed charge, plus a variable cost after a certain number...

  • Please solve this for me. Its very urgent. Solve it correctly. Delayed Deposit Services DELAYED DEPOSIT...

    Please solve this for me. Its very urgent. Solve it correctly. Delayed Deposit Services DELAYED DEPOSIT SERVICES, §533D.9 533D.9 Fee restriction — required disclosure. 1. A licensee shall not charge a fee in excess of fifteen dollars on the first one hundred dollars on the face amount of a check or more than ten dollars on subsequent one hundred dollar increments on the face amount of the check for services provided by the licensee, or pro rata for any portion...

  • Please help me to solve this problem. Thank you so much. 3. The manufacturing of Styrofoam...

    Please help me to solve this problem. Thank you so much. 3. The manufacturing of Styrofoam coffee cups causes damage to a local river when the manufacturing plant produces more than 500 units in a period. To discourage the plant from producing more than 500 units, the local community is considering placing a tax on the plant. The long-run cost curve for the firm 0t, where q is the number of coffee cups + tq, where q is the number...

  • SOLVE USING MATLAB A servomechanism position control has the plant transfer function 10 s(s +1) (s 10) You are to desig...

    SOLVE USING MATLAB A servomechanism position control has the plant transfer function 10 s(s +1) (s 10) You are to design a series compensation transfer function D(s) in the unity feedback configuration to meet the following closed-loop specifications: . The response to a reference step input is to have no more than 16% overshoot. . The response to a reference step input is to have a rise time of no more than 0.4 sec. The steady-state error to a unit...

  • MATLAB help! I have some MATLAB Assignment to do, the proffesor requires all the small parts...

    MATLAB help! I have some MATLAB Assignment to do, the proffesor requires all the small parts in order to get full credit. Help me out, thank you f LAB SECTION NAME HW6P3 (30 points) following are infinite series representations of the function, un pra i a script file HW6P3 that determines the value of the function from the sum of the series for a given value of x. The program (1 pt) must prompt the user to enter a value...

  • Unable to correct errors from my MatLab Script and would like to see a script to...

    Unable to correct errors from my MatLab Script and would like to see a script to compare mine to. Write a MatLab script that simulates a virus spread. This problem needs the following parts, some of which are nested loops, ie Part 3, 4 and 5 are nested in Part 2’s loop (for or while): To build the program first to only deal with infection transmission within the town’s neighbors An array which for every person in the town which...

  • A potato processing firm is supplying French fries to a fast food restaurant chain. In the...

    A potato processing firm is supplying French fries to a fast food restaurant chain. In the short run under its current facility constraint, each day it can produce the first 1 unit for $2000 variable cost, the second unit for $1500, the third unit for $1900, the fourth unit for $2100, the fifth unit for $2500, and the six unit at $3000 to reach full capacity. The price it sells to the restaurant chain is $2500/unit. The per day (very...

  • C PROGRAMMING Introduction In this part, you will solve a problem described in English. Although you...

    C PROGRAMMING Introduction In this part, you will solve a problem described in English. Although you may discuss ideas with your classmates, etc., everyone must write and submit their own version of the program. Do NOT use anyone else’s code, as this will result in a zero for you and the other person! Shipping Calculator Speedy Shipping Company will ship your package based on the weight and how far you are sending the package, which can be anywhere in the...

  • Cost Patterns The graphs below represent approximations of cost behavior patterns. The horizontal axis of each...

    Cost Patterns The graphs below represent approximations of cost behavior patterns. The horizontal axis of each graph represents units and the vertical axis represents dollars of total cost. Select the graph that best matches each of the situations described below. Each graph may be selected more than once (Select the appropriate graph by using the drop-down answer box found at the end of each situation.) a. Straight-line depreciation of a factory building.* b. Utility bill for electricity that includes a...

  • Giaph/Chart B D F H hei 1 K Select the graph that matches the numbered manufacturing...

    Giaph/Chart B D F H hei 1 K Select the graph that matches the numbered manufacturing cost data. Indicate by letter which graph best fits the situation or item described. (Click to view the graphs.) The vertical axes of the graphs represent total cost, and the horizontal axes represent units produced during a calendar year. In each case, the zero point of dollars and production is at the intersection of the two axes. The graphs may be used more than...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT