% % Written by: % -- % John L. Weatherwax 2006-12-31 % % email: wax@alum.mit.edu % % Please send comments and especially bug reports to the % above email address. % %----- close all; E1 = 1; E2 = 2; Ns = 100; S = linspace(0,6,Ns); PI = max( [ max(S-E2,0)-E1; max(E2-S,0)-E1; zeros(1,Ns) ] ); figure; plot( S, PI, 'o-' ); xlabel('stock price at expiry'); ylabel('portfolio profit'); saveas( gcf, '../../WriteUp/Graphics/Chapter11/prob_11_5.eps' );