Contents

Script File for Ch3 problem #12

% Created on October 3, 2007.
% File Finding_Length: Computes the length(L) and the total lenth
% given the area and the width and distane. See figure P12.

% Imput variables:
% W = Width of the figure
% A = Area of the figure

% Output variables:
% L = Length of figure
% L_Total = Total lenght of the fence required

Imput section

W = input('Width value: ')
A = input('Total area: ')
Error using ==> input
Cannot call INPUT from EVALC.

Calculation section

L = (A - (W*cos(pi/4))^2/2)/W

L_Total = W + 2*L + 2*W*cos(pi/4)

Output section

disp('Length of fence requred: ')
disp(L)
disp('Total length of fence requred: ')
disp(L_Total)