Message Boards Message Boards

0
|
2714 Views
|
1 Reply
|
1 Total Likes
View groups...
Share
Share this post:

How to share functions between notebooks?

Posted 2 years ago

So I did this notebook, with a bunch of utility functions dealing with Rotation Vectors... (something like quaternions, but not)

I would like to then use these in other notebooks with a minimum of boilerplate... how do I export a set of functions and import them somewhere else?

https://www.wolframcloud.com/obj/f921ce60-b671-475e-bea4-0053bc0308a6

POSTED BY: J Decker
Posted 2 years ago

An easy way to do that is to add this to the notebook and evaluate it once.

SetOptions[EvaluationNotebook[], AutoGeneratedPackage -> Automatic]

Set the cells of functions you want to export as Initialization cells. With that setup, whenever you save the notebook a corresponding .m file is created with the exported functions. To use them in a different notebook, use Get to load the .m file.

POSTED BY: Rohit Namjoshi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract