yword">for</span>(i=1:get(sm,<span class="string">'numSims'</span>))  <span class="comment">%for each simulation</span>
  <span class="keyword">for</span>(j=1:length(v))    <span class="comment">%for each bond tenor</span>
    steps=linspace(1/2,v(j),2*v(j));    <span class="comment">%coupon payment and maturity (i.e. cash-flow) dates</span>
    p=(1+interp1(get(sm,<span class="string">'simTenor'</span>),R(:,:,i)',steps)')<span class="keyword">...</span>
      .^(-kron(steps,ones(get(sm,<span class="string"