From: Matt Fig on
"Matt Fig" <spamanon(a)yahoo.com> wrote in message
> This may be even faster on some systems:
>
> idx = [ones(1,NSims);(StockPrice>H);inf(1,NSims)];
> idx = strfind(idx(:).',[1 zeros(1,D)]);
> ParisPayoffs4 = max(StockPrice(Length+1,:)-K,0);
> ParisPayoffs4(ceil(idx/(Length+3))) = 0;




I don't know why I thought I needed to pad with an INF. This is faster without that padding, and changing the index in the last line to (Length + 2) instead of (Length + 3). Sorry for the confusion.