modify the following program so as to plot the Black-Scholes prices for put options (instead of calls – so you need to look up the full features of blsprice in MATLAB) with the price of the underlying fixed at 50 but strike prices varying between 35 and 65 in steps of 5. All the other parameters remain the same.
Plotting the Black–Scholes price of a vanilla call option, for time to maturity
T ranging from one year down to zero, initial price S0 ranging from 30 to 70,
strike price K = 50, risk-free rate r = 0.1, and volatility = 0.4.
>> T = 1:-0.05:0;
>> S0 = 30:70;
>> K = 50;
>> sigma = 0.4;
>> r = 0.1;
>> [X,Y] = meshgrid(T,S0);
>> f = @(time,price) blsprice(price, 50, 0.1, time, 0.4);
>> surf(X,Y,f(X,Y))