install_matpower
- install_matpower(modify, save_it, verbose, rm_oldpaths)
install_matpower()
- Assist user in setting path to install MATPOWER.install_matpower install_matpower(modify) install_matpower(modify, save_it) install_matpower(modify, save_it, verbose) install_matpower(modify, save_it, verbose, rm_oldpaths) success = install_matpower(...)
Assists the user in setting up the proper MATLAB/Octave path to be able to use MATPOWER and run its tests. With no input arguments it prompts interactively to determine how to handle the paths.
Note
This function is generally not in your MATLAB/Octave path, unless you change your current working directory to the MATPOWER install directory where it is located.
There are two main approaches for installing MATPOWER.
If you have a single version of MATPOWER, select the options to modify and save the path (interactive option 3). This will add MATPOWER to your default MATLAB/Octave path for all future sessions.
If you have multiple versions of MATPOWER, select the options to not modify the path (interactive option 1), but to save the
addpath()
commands to a file. Then execute the saved file to use this version of MATPOWER.
All inputs and outputs are optional.
- Inputs:
modify (boolean) – select how to set path
0 (default) - generate relevant
addpath()
commands, but don’t execute them; MATPOWER is not installed1 - modify the path by executing the relevant
addpath()
commands; MATPOWER is installed for this session
save_it (integer or string) – indicates whether or not to save the results
0 or [] (default) - don’t save any results
if
modify
is 0save_it
=<string>
: the relevantaddpath()
commands are saved to a file whose name is provided insave_it
; execute saved file in any session to make MATPOWER available for the sessionsave_it
=<other true value>
: the relevantaddpath()
commands are saved to a file named'startup.m'
in the current directory; MATPOWER is available in any session affected by this'startup.m'
fileotherwise : the commands are displayed, but not saved
if
modify
is 1save_it
=<any true value>
: the path will be modified and saved withsavepath()
; MATPOWER is available in this and all future sessionsotherwise : the path will be modified but not saved
verbose (boolean) – prints the relevant
addpath()
commands if true (default), silent otherwiserm_oldpaths (boolean) – remove existing installation
0 (default) - do not remove existing MATPOWER from path
1 - remove existing MATPOWER paths first
- Output:
success (boolean) – 1 if all commands succeeded, 0 otherwise
Examples:
install_matpower % interactive mode, prompt for options install_matpower(0); % print the required addpath() commands install_matpower(0, 1); % save the commands to startup.m install_matpower(1, 1); % modify my path and save install_matpower(1, 0, 0); % modify my path temporarily & silently install_matpower(0, 'matpower8'); % save the commands to matpower8.m install_matpower(0, 0, 1, 1); % uninstall MATPOWER from path (must % call savepath() separately to make % permanent)
See also
addpath
,savepath
.