%标的资产价格(上证50ETF)
Price=2.712;
%执行价格
Strike=2.7;
%无风险收益率(年化)2.8%
Rate=0.028;
%剩余期限
Time=(0:1:27)/365;
%年化波动率
Volatility=0.30;
%建立二维坐标系
[Price,Time]=meshgrid(Price,Time);
[Call, Put]=blsprice(Price,Strike,Rate,Time,Volatility);
%绘制三维图形
mesh(Price,Time,Call)
xlabel('标的资产价格')
ylabel('剩余期限')
zlabel('Call')
title('看涨期权价格与标的资产价格、剩余期限的关系')