Adrian Panasiuk
Adrian Panasiuk

Reputation: 7343

octave: load many functions from single file

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.

Upvotes: 10

Views: 9266

Answers (2)

Boki
Boki

Reputation: 91

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.

Upvotes: 9

Gunnlaugur Briem
Gunnlaugur Briem

Reputation: 2804

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

Upvotes: 8

Related Questions