Code covered by the BSD License  

Highlights from
externalfcn

1.0

1.0 | 1 rating Rate this file 8 Downloads (last 30 days) File Size: 1.34 KB File ID: #4361

externalfcn

by

 

13 Jan 2004 (Updated )

Enables calls to functions outside of the current path.

| Watch this File

File Information
Description

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.

Acknowledgements

This file inspired Execin.

MATLAB release MATLAB 6.5 (R13)
Other requirements Tested under MATLAB 6.5 (R13) and MATLAB 6.1 (R12.1)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (1)
03 Jun 2013 Thierry Dalon

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{:})

Contact us