function breakeven(C,S,F) % function breakeven(C,S,F) % this function will prepare a break even chart with linear cost and % sales income lines. % S. Scott Moor March 2008 % % Inputs: C = Variable Cost ($/unit) % S = Sales Price ($/unit) % F = Fixed cost (million $) % Output: A Break even graph with axes in millions of units and millions % of dollars. % Internal Variables: % xBE = vnit volume for breakeven point (millions of units) % x = vector of unit volumes from zero to two times the break even volume % Cost = vector of total cost for the unit volumes in x % Sales = vector of sales inclome the for unit volumes in x % BE = text variable of unit volume for breakeven point (millions of units) % Ft, Ct, St = text variables for graph title containing the input values % % Solve for break even point xBE = F./(S - C); % Prepare x vector (millions of units produced) x = linspace(0,2*xBE,50); % Prepare the cost vector Cost = F + C.*x; % Pepare sales income vector Sales = S.*x; % set up fixed cost vectors x1 = [0, 2*xBE]; y = [F, F]; % Plot breakeven chart with a marker at the breakeven even point and label the plot plot(x,Cost,x,Sales,'--',x1,y,':', xBE, xBE*S,'p','MarkerSize',12) xlabel('Production Quantity (million units)'); ylabel('Production Cost or Sales Income(million $)') % Convert breakeven point to a string variable and use in graph legend BE = num2str(xBE); legend('Total Production Cost','Total Sales Income', 'Fixed Costs', ... ['Breakeven Point = ' BE,' million units'], 'Location','NorthWest') % Convert input values to strings and form a graph title that displays the inputs Ft = ['Fixed Costs = ', num2str(F),' million $, ']; St = ['Sales Price = ', num2str(S), ' $/unit, ']; Ct = ['Variable Cost = ', num2str(C), ' $/unit']; title(['Breakeven Chart: ',Ft,St,Ct])