function [FloorPrice, Floorlets] = floorbynormal(RateSpec, Strike, Settle, Maturity, Vol ,varargin)
%FLOORBYNORMAL Price floors using the Normal option pricing model.
%
%   [FloorPrice, Floorlets] = floorbynormal(RateSpec, Strike, Settle, Maturity,...
%                                        Volatility)
%
%   [FloorPrice, Floorlets] = floorbynormal(RateSpec, Strike, Settle, Maturity,...
%                                        Volatility, 'Name1', Value1...)
%
% Inputs:
%   RateSpec    - The annualized continuously compounded rate term 
%                 structure. Type "help intenvset" for information
%                 on the interest rate specification.
%   Strike    	- NINST x 1 vector of rates at which the cap is exercised, as a 
%                 decimal number. 
%   Settle    	- NINST x 1 vector of dates representing the settle date of the cap.
%   Maturity  	- NINST x1 vector of dates representing the maturity date of the cap.
%   Volatility  - NINST x1 vector of volatilities.
%
% Optional Inputs:
%   All optional inputs are specified as matching parameter name/value pairs.
%   The parameter name is specified as a character string, followed by the 
%   corresponding parameter value. Parameter name/value pairs may be specified
%   in any order; names are case-insensitive and partial string matches are 
%   allowed provided no ambiguities exist. Valid parameter names are as follows:
%
%   Reset       - NINST x 1 vector representing the frequency of payments per year.
%                 Default is 1.
%   Principal   - NINST x 1 of notional principal amounts or NINSTx1 cell array
%                 where each element is a NumDates x 2 cell array where the 
%                 first column is dates and the second column is associated 
%                 principal amount.  The date indicates the last day that the  
%                 principal value is valid. Default is 100.
%	Basis     	- NINST x 1 vector representing the basis used when annualizing the 
%                 input forward rate. Default is 0 (actual/actual)
%   ValuationDate - Scalar representing the observation date of the 
%                   investment horizons. Default is Settle.
%   ProjectionCurve - RateSpec of the interest rate curve used to project
%                     future cash flows. Use this optional input if this
%                     forward curve is different from the discount curve.
%
% Outputs:
%   FloorPrice   - NINST x 1 expected prices of the floor.
%	Floorlets    - NINST x NCF array of floorlets, padded with NaNs.
%
%
% Notes: FLOORBYNORMAL computes prices of vanilla floors and amortizing floors.
%
% See also CAPBYNORMAL, CAPBYBLK

%   Copyright 1998-2016 The MathWorks, Inc. 

narginchk(5, 15)

[FloorPrice, Floorlets] = capfloorbyblack('floor', RateSpec, Strike, Settle, ...
    Maturity, Vol, 'model','normal', varargin{:});