I have a Mathematica file that I saved. In it, I have multiple functions that I've defined and have evaluated a number of the functions with different arguments. I would like to be able to open the file and essentially execute the commands at once without having to select and run each individual function. I know Maple used to have a function that did this, but does Mathematica have one?
Asked
Active
Viewed 1,787 times
3
-
4If you want to evaluate your file without opening Mathematica's notebook GUI you might want to use it as a script. If you want to evaluate the cells when you open a notebook you can use initialization cells. If you want to evaluate the cells inside Mathematica all at once, but want to start it yourself, you can choose Evaluation -> Evaluate Notebook. There are some other options there as well. – C. E. May 03 '15 at 16:22
-
@Pickett if this is not a duplicate your comment deserves conversion into an answer. – Yves Klett May 03 '15 at 16:26
-
Okay, i understand now. I'm much more familiar with Maple, but my school offers Mathematica free for students, so I'm getting familiarized. The Evaluation tab and evaluate notebook worked exactly like I wanted. Thank you. And yes, if you convert to an answer I'll upvote it. – Iceman May 03 '15 at 16:33
-
Related question. – m_goldberg May 04 '15 at 01:48
1 Answers
7
Three options that spring to mind:
- You can run Mathematica code without opening a notebook by treating it as a Mathematica script.
- You can tell Mathematica to evaluate certain cells every time the notebook opens by designating those cells as initialization cells.
- Under the evaluation tab in the menu there are different options for queueing cells for evaluation, for example Evaluate -> Evaluate Notebook.
C. E.
- 70,533
- 6
- 140
- 264