% hyperparameters (2D case) expX = [ 10, 10, 10, .001 ]; X = log(expX); % 2D inputs input = [ 1,1; 1,0; 0,1; 0,0 ]; target = [ 1; 2; 2; 0 ]; % test points [x,y] = meshgrid( -1:0.1:1); test = [x(:),y(:)]; % call [mu, S2] = gp01pred(X, input, target, test); mu = real(mu); % plot z = reshape(mu,size(x)); mesh(x,y,z); hold on z = reshape(mu+sqrt(S2),size(x)); mesh(x,y,z); plot3(input(:,1),input(:,2),target,'r*'); hold off