%% Determine the Mortgage-Backed Security Price Given the Yield
% This example shows how to determine the mortgage-backed security price given a mortgage-backed security with the following characteristics.

Yield = 0.0725;
Settle = datenum('15-Apr-2002');
Maturity = datenum('1 Jan 2030');
IssueDate = datenum('1-Jan-2000');
GrossRate = 0.08125;
CouponRate = 0.075;
Delay = 14;
Speed = 100;

[Price AccrInt] = mbsprice(Yield, Settle, Maturity, IssueDate,...
GrossRate, CouponRate, Delay, Speed)

% Copyright 2015 The MathWorks, Inc.