www.gusucode.com > fininst 案例源码程序 matlab代码 > fininst/CreateaStockSpecforStocksWithCashDividendsExample.m

    %% Create a |StockSpec| for Stocks With Cash Dividends

% Copyright 2015 The MathWorks, Inc.


%% 
% Consider a stock that provides four cash dividends of $0.50 on January
% 3, 2008, April 1, 2008, July 5, 2008 and October 1, 2008. The stock is
% trading at $50, and has a volatility of 20% per annum. Using this data,
% create the structure |StockSpec|:  
AssetPrice = 50;
Sigma = 0.20;

DividendType = {'cash'};
DividendAmounts = [0.50, 0.50, 0.50, 0.50];
ExDividendDates = {'03-Jan-2008', '01-Apr-2008', '05-July-2008', '01-Oct-2008'};
 
StockSpec = stockspec(Sigma, AssetPrice, DividendType, DividendAmounts, ExDividendDates)  

%% 
% Examine the |StockSpec| structure. 
datedisp(StockSpec.ExDividendDates)
StockSpec.DividendType 

%%
% The |StockSpec| structure encapsulates the information of the stock and
% its four cash dividends.