version (1.74 KB) by Jiro Doke
Executes functions and scripts not in the path.


Updated 1 Sep 2016

View License

EXECIN Execute a function or script in different directory.

EXECIN(FUNCNAME) will execute function FUNCNAME, which is a string that includes the full path of the function.

[Y1, Y2, ...] = EXECIN(FUNCNAME, X1, X2, ...) allows input and output arguments that are normally allowed by the function FUNCNAME.

[s, out] = execin('C:\mywork dir\testfunction.m', x1, x2);

This is quite similar to Brett Shoelson's EXTERNALFCN. I didn't realize it until I made it. But there are some advantages such as ability to call functions without output arguments, and assigning outputs in the caller workspace (not base).

Cite As

Jiro Doke (2022). EXECIN (https://www.mathworks.com/matlabcentral/fileexchange/8518-execin), MATLAB Central File Exchange. Retrieved .

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

Inspired by: externalfcn

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!