

<span class="keyword">if</span> nargout &lt; 4; [M, S, V] = gp2(gpmodel, m, s); <span class="keyword">return</span>; <span class="keyword">end</span>

<span class="keyword">persistent</span> K iK oldX oldIn oldOut beta oldn;           <span class="comment">% cache some variables</span>
D = size(input,2);         <span class="comment">% number of examples and dimension of input space</span>
[n, E] = size(target);               <span class="comment">% number of examples and number of outputs</span>
X = resh