File Exchange

image thumbnail

externalfcn

version 1.0.0.0 (1.34 KB) by Brett Shoelson
Enables calls to functions outside of the current path.

1 Download

Updated 15 Jan 2004

View License

Parses string arguments to enable calls to functions outside of the current workspace. (Function externalfcn must, of course, be defined in the current path.)

EX:
externalfcn('[x,y] = c:\testdirectory\testfcn(a,b)')

...will call testfcn.m even if 'c:\testdirectory\' is not currently defined on the path.

Cite As

Brett Shoelson (2020). externalfcn (https://www.mathworks.com/matlabcentral/fileexchange/4361-externalfcn), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (1)

Isn't it a bit complicated for simply something like:
function [varargout]=funeval(fun,varargin)
% INPUT:
% fun: (char) full path to function file
curdir=cd;
[fundir,funname]=fileparts(fun);
cd(fundir);
[varargout{1:nargout}] =feval(funname,varargin{:})

Updates

1.0.0.0

A spelling error in the title of the submission....

MATLAB Release Compatibility
Created with R13
Compatible with any release
Platform Compatibility
Windows macOS Linux
Acknowledgements

Inspired: EXECIN