


wrap an internal function provided by Christian Borchert Syntax: varargout = wrapExternBorchertFunction(funName, varargin) THIS FUNCTION IS NO USER FUNCTION. IT ONLY WRAPS FUNCTIONALITY. See also: obtainCrystal, viewCrystal, editCrystal


0001 function varargout = executeExternBorchertFunction(funName, varargin) 0002 % wrap an internal function provided by Christian Borchert 0003 % 0004 % Syntax: varargout = wrapExternBorchertFunction(funName, varargin) 0005 % 0006 % THIS FUNCTION IS NO USER FUNCTION. IT ONLY WRAPS FUNCTIONALITY. 0007 % 0008 % See also: obtainCrystal, viewCrystal, editCrystal 0009 0010 % The elk-library: convex geometry applied to crystallization modeling. 0011 % Copyright (C) 2013 Alexander Reinhold 0012 % 0013 % This program is free software: you can redistribute it and/or modify it 0014 % under the terms of the GNU General Public License as published by the 0015 % Free Software Foundation, either version 3 of the License, or (at your 0016 % option) any later version. 0017 % 0018 % This program is distributed in the hope that it will be useful, but 0019 % WITHOUT ANY WARRANTY; without even the implied warranty of 0020 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0021 % General Public License for more details. 0022 % 0023 % You should have received a copy of the GNU General Public License along 0024 % with this program. If not, see <http://www.gnu.org/licenses/>. 0025 0026 %% Parameters 0027 borchertDir = 'borchert-05-2010'; 0028 0029 %% Add external path 0030 borchertPath = [fileparts(which(mfilename)) filesep borchertDir]; 0031 addpath(borchertPath) 0032 0033 %% Evaluate 0034 try 0035 varargout{1:nargout} = feval(funName, varargin{:}); 0036 % Remove required paths 0037 rmpath(borchertPath); 0038 0039 catch thisError 0040 % Remove required paths anyway 0041 rmpath(borchertPath); 0042 rethrow(thisError); 0043 end 0044