开发者

Set the scope of a self-written function to global in MATLAB

开发者 https://www.devze.com 2023-02-08 02:55 出处:网络
Assume I have written a function fun(a,b,c) in Matlab and saved it ..\\My Documents\\MATLAB\\fun.m . How can I make it available to all functions in Matlab.

Assume I have written a function fun(a,b,c) in Matlab and saved it ..\My Documents\MATLAB\fun.m . How can I make it available to all functions in Matlab.

In other w开发者_JS百科ords: What needs to be done in order to call this function from any other matlab-file (script, function) without being in the directory the file is stored in?


I believe you can achieve this effect by adding the file to the path - http://web.cecs.pdx.edu/~gerry/MATLAB/howTo/setMATLABpath.html#pathCommand


You can create your own structured function library and install/uninstall to the MATLAB path with this library template:

https://github.com/tiborsimon/MATLAB-Library-System-template

0

精彩评论

暂无评论...
验证码 换一张
取 消