I have several functions in different .sci files. Also, these files are in different directories. These functions are used by a main program.
With old Scilab versions I have used getf(...) to load all the functions (one getf(...) per function, of course) and getf(...) to load the main program too.
The questions are:
- How do I load the main program and all the functions into
Scilab‘s new version/environment? - What about Matlab?
As Sylvestre points out in Scilab you call
exec()with the filename of your module.In Matlab it’s not a directly comparable operation (this is one of the areas they diverge): you place each external function in a file whose filename matches the function name then put that file in the path: when you call the function Matlab searches the path for matching files. This does mean you can only have one function per file but if you want C-style
#includefunctionality there are various methods on this thread.For your purposes – multiple directories – you might want to add each relevant directory to the path in your startup.m file. See also How to use the MATLAB search path.