% Add Up Bruce Mayer, PE

% MTH-15 • 25Jun13

%

clear; clc; clf; % clf clears figure window

%

% The Limits

xmin = 0; xmax = 10; ymin = 0; ymax = 20;

% The FUNCTION

x = linspace(xmin,xmax,500); y1 = (-8/25)*(x-5).^2 + 10; y2 = 11*exp(-x/6)+9;

%

% the 6x6 Plot

axes; set(gca,'FontSize',12);

whitebg([0.8 1 1]); % Chg Plot BackGround to Blue-Green

subplot(1,3,2)

area(x,y1,'FaceColor',[1 .8 .4], 'LineWidth', 3),axis([xminxmaxyminymax]),...

grid, xlabel('\fontsize{14}x'),ylabel('\fontsize{14}ylo = (-8/25)*(x-5)^2+10 • yhi = 11e^-^x^/^6+9'),...

title(['\fontsize{16}MTH15 • Area Between Curves',]),...

annotation('textbox',[.5 .05 .0 .1], 'FitBoxToText', 'on', 'EdgeColor', 'none', 'String', 'Bruce Mayer, PE • 25Jul13','FontSize',7)

hold on

set(gca,'XTick',[xmin:2:xmax]); set(gca,'YTick',[ymin:2:ymax])

set(gca,'Layer','top')

hold off

%

subplot(1,3,1)

area(x,y2, 'FaceColor',[0 1 0], 'LineWidth', 3),axis([xminxmaxyminymax]),...

grid, xlabel('\fontsize{14}x'),...

annotation('textbox',[.15 .05 .0 .1], 'FitBoxToText', 'on', 'EdgeColor', 'none', 'String', 'Bruce Mayer, PE • 25Jul13','FontSize',7)

hold on

set(gca,'XTick',[xmin:2:xmax]); set(gca,'YTick',[ymin:2:ymax])

set(gca,'Layer','top')

hold off

%

xn = linspace(xmin, xmax, 500);

subplot(1,3,3)

fill([xn,fliplr(xn)],[(-8/25)*(xn-5).^2 + 10, fliplr(11*exp(-xn/6)+9)],'m'),axis([xminxmaxyminymax]),...

grid, xlabel('\fontsize{14}x'),...

annotation('textbox',[.85 .05 .0 .1], 'FitBoxToText', 'on', 'EdgeColor', 'none', 'String', 'Bruce Mayer, PE • 25Jul13','FontSize',7)

hold on

set(gca,'XTick',[xmin:2:xmax]); set(gca,'YTick',[ymin:2:ymax])

set(gca,'Layer','top')

hold off

%

disp('Showing SubPlot - Hit Any Key to Continue')

pause

%

clf

fill([xn,fliplr(xn)],[(-8/25)*(xn-5).^2 + 10, fliplr(11*exp(-xn/6)+9)],'m'),axis([xminxmaxyminymax]),...

grid, xlabel('\fontsize{14}x'),,ylabel('\fontsize{14}ylo = (-8/25)*(x-5)^2+10 • yhi = 11e^-^x^/^6+9'),...

title(['\fontsize{16}MTH15 • Area Between Curves',]),...

annotation('textbox',[.6 .05 .0 .1], 'FitBoxToText', 'on', 'EdgeColor', 'none', 'String', 'Bruce Mayer, PE • 25Jul13','FontSize',7)

hold on

set(gca,'XTick',[xmin:2:xmax]); set(gca,'YTick',[ymin:2:ymax])

set(gca,'Layer','top')

hold off

MATLAB Code