I DID THIS:
Do not put it in the MATLAB toolbox. Download the .zip file, and unzip it into a directory that has nothing else in it (and which is not under the MATLAB installation.) Then use pathtool to add the directory to the MATLAB path. After that MATLAB will be able to find the file.
but it gives error: Error in fminsearchbnd (line 264)
[xu,fval,exitflag,output] = fminsearch(intrafun,x0u,options,varargin);
what might be the problem?