GUI using functions from another m.file

2 views (last 30 days)
Hello. I am beginning to study GUI building basics. Here is what I want to do. There is file with specific format, it can be read with specific function that is stored in .m file. I do not want include code of that function in my guy.m file. Is it possible to connect, link or include gui and various m.files? Do they just have to be put into one folder and after complitating is complete exe. file will be able to use function from m.file?

Accepted Answer

Walter Roberson
Walter Roberson on 24 Nov 2015
You can have difficulty if you have a call to a function and that call is hidden inside a string, such as if you were to use
ode45('SomeFunctionName',....)
If you have calls like that then you may need to use a %#function pragma to tell MATLAB to include the function.
If your calls to the function are "obvious", then as long as the file with that name is on your MATLAB path, the MATLAB Compiler will be able to find it and will include it when building the .exe

More Answers (0)

Categories

Find more on Environment and Settings in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!