Documentation 
Optionadjusted spread given yield
OAS = mbsyield2oas(ZeroCurve, Yield, Settle, Maturity, IssueDate,
GrossRate, CouponRate, Delay, Interpolation PrepaySpeed,
PrepayMatrix)
ZeroCurve  A matrix of three columns:

Yield  Mortgage yield, compounded monthly (in decimal). 
Settle  Settlement date (scalar only). A serial date number or date string. Date when optionadjusted spread is calculated. Settle must be earlier than Maturity. 
Maturity  Maturity date. Scalar or vector in serial date number or date string format. 
IssueDate  Issue date. A serial date number or date string. 
GrossRate  Gross coupon rate (including fees), in decimal. 
CouponRate  (Optional) Net coupon rate, in decimal. Default = GrossRate. 
Delay  (Optional) Delay (in days) between payment from homeowner and receipt by bondholder. Default = 0 (no delay between payment and receipt). 
Interpolation  Interpolation method. Computes the corresponding spot rates for the bond's cash flow. Available methods are (0) nearest, (1) linear, and (2) cubic spline. Default = 1. See interp1 for more information. 
(Optional) Relation of the conditional payment rate (CPR) to the benchmark model. Default = end of month's CPR. Set PrepaySpeed to [] if you input a customized prepayment matrix.  
PrepayMatrix  (Optional) Customized prepayment matrix. A matrix of size max(TermRemaining)byNMBS. Missing values are padded with NaNs. Each column corresponds to a mortgagebacked security, and each row corresponds to each month after settlement. 
All inputs (except PrepayMatrix) are number of mortgagebacked securities (NMBS) by 1 vectors.
OAS = mbsyield2oas(ZeroCurve, Yield, Settle, Maturity, IssueDate, GrossRate, CouponRate, Delay, Interpolation, PrepaySpeed, PrepayMatrix) computes the optionadjusted spread in basis points.