10

How can I put multiple functions in one file and later get access to all of them in the octave interpreter ? I don't want to have a thousand files and want to group functions together. I'd like something like 'import' in python.

Adrian Panasiuk
  • 7,249
  • 5
  • 33
  • 54

2 Answers2

9

Once you have saved all your function definitions in a single script file, use source("filename") to have access to these functions within the interpreter.

Haile
  • 3,120
  • 3
  • 24
  • 40
Boki
  • 91
  • 1
  • 3
8

What you're looking for is called “script files”, defined there: http://www.gnu.org/software/octave/doc/interpreter/Script-Files.html

Gunnlaugur Briem
  • 2,684
  • 2
  • 23
  • 24