0

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?
Tomas Aschan
  • 58,548
  • 56
  • 243
  • 402
Papiro
  • 149
  • 11

2 Answers2

2

exec replaces gef: http://help.scilab.org/docs/current/en_US/exec.html

But if you are starting to write a Scilab module (extension), you should have a look to the toolbox skeleton provided with Scilab.

Sylvestre
  • 352
  • 1
  • 7
1

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 #include functionality 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.

Community
  • 1
  • 1
xenoclast
  • 1,635
  • 15
  • 26