帮别人写的, 大家看看吧......
 fzero迭代就截..... 看 help fzero 效率高些
 %[Call, Put] = blsprice(Price, Strike, Rate, Time, Volatility, Yield)
%N表示总股本,M表示认股权证数量 
N=64.553;
M=12.65;
stk_price=45; %('股票现价');
strick_price=40;%('执行价格');
m_time=5; %('年化存续期');
vol=0.30; %('波动率');
rate=0.0252; %Annualized, continuously compounded risk-free rate of 
 %return over the life of the option, expressed as a positive decimal number.
pchange=0.05; %('敏感性分析中的价格变化幅度');
vchange=0.05; %('敏感性分析中的隐含波动率变化幅度');
bls=blsprice(stk_price, strick_price, rate, m_time, vol);
result=fzero(@(w) obj(w,stk_price, M, N, strick_price, rate, m_time, vol),bls)
 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
 function f=obj(w,stk_price, M, N, strick_price, rate, m_time,vol)
f=blsprice(stk_price+(M/N)*w, strick_price, rate, m_time, vol)*N/(M+N)-w;