Reputation: 3520
I have a matlab code which contains several .m files in sub folders. When I call the matlab I am using the following function.
addpath(genpath('myfolder'));
My code uses some other libraries such as liblinear
.
My question is how can I create a matlab executables from my code.
How should I add the subfolders and 'addpath'?
How can I include my liblinear
functions there (from liblinear
library/code)?
Upvotes: 1
Views: 476
Reputation: 20915
Matlab compiler crawls through your files and figures out the dependencies by himself.
Thus, in most case you don't need to do anything. It will add mex
files as well (which are in the path), such as liblinear.mex
.
However, in some cases the compiler cannot figure out what functions to add to the compiled archive.
eval
.You need to help him by adding pragma in your .m
files:
%#function MyFunc1
...
eval('MyFunc1');
...
Or adding the files in the compilation command:
mcc .... -a MyFunc1.m
Upvotes: 1