Reputation: 3510
How can I execute a MATLAB file (say "text1.m") from another MATLAB file ("main.m")?
I tried MATLAB's eval
function but it didn't work:
evalc('K:\DOWNLOADS\experiments\bag_of_words\config_file_1.m');
Upvotes: 1
Views: 644
Reputation: 124543
If the M-file is not on the path, there is a convenience function RUN to run scripts.
Upvotes: 1
Reputation: 1353
If it is a script you can directly call it using its filename (without ".m") in another M-file script (similar to a function-call without any arguments or parentheses). If it declares a function it should be in the MATLAB search path or in the current folder for you to be able to call the function. This is likely also the case for scripts.
Upvotes: 3