If one adds GPmat to MATLAB's path, then this causes the GPmat implementation of fcnchk to replace MATLAB's provided function named fcnchk. This causes errors if one needs to use fminunc, for example.
The following example code:
addpath('/path/to/GPmat');
myfunc = @(x) x^2;
x0 = 1;
fOpt = fminunc(myfunc, x0);
...produces the following output:
Error using fcnchk
Too many output arguments.
Error in optimfcnchk (line 83)
[funfcn, idandmsg] = fcnchk(funstr,lenVarIn); %#ok<DFCNCHK>
Error in fminunc (line 249)
funfcn = optimfcnchk(FUN,'fminunc',length(varargin),funValCheck,gradflag,hessflag);
Using MATLAB R2016b.