startup - EranOfek/AstroPack GitHub Wiki
Introduction
When a new MATLAB session is created it looks for a startup.m file in its default search path, and execute it. This file can be used to add additional directories to the MATLAB search path (using the addpath command) and change some of the default parameters.
AstroPack/MAATv2 is distributed with a default startup.m file that resides in the ~/matlab/AstroPack/matlab/startup/startup.m directory.
Do not modify the startup file. Read below on how to use it.
How to use the default startup.m file?
There are a few options:
- create your own startup file (e.g., in the home directory or
/matlab directory), and from this file, call the _/matlab/AstroPack/matlab/startup/startup(arguments)_ function with the appropriate arguments (see below). This option is recommended, as it will allow you to pull new version of AstroPack including the startup.m file. - Copy the startup file to your home directory or ~/matlab directory and modify it. If you use this option and the startup.m file distributed with AstroPack is modified then it is your responsibility to update your own startup file.
- Use your own startup file.
What the startup file is doing?
The AstroPack startup.m file is doing the following:
- Set some of the graphic defaults - e.g., 'DefaultAxesFontSize',14, 'DefaultAxesFontName','times'.
- Shuffle the random number generator seed using the rng('shuffle') command.
- Set the matlab format using format short g
- Add the RAD=180./pi as a constant to the matlab base.
- Add all the relevant AstroPack directories to the matlab search path.
- Add the ~matlab/data directories to the matlab search path. These directories are defined in the AstroPack configuration file (see install web page).
- Add the configuration directory to the search path.
- Add the catsHTM directories to the search path.
Passing arguments to the startup.m file
The user can pass arguments to the startup function in order to control its behavior. For example, skip some of the steps, define the base path for the directories (e.g., the directory under the data/ or catsHTM/ directory tree is located), and finally it is possible to pass some of these arguments as system environment variables.