from
Settings File
by Roy Schestowitz
Get settings from file.
|
| my_program (args) |
function [] = my_program (args)
% MY_PROGRAM: Gets settings from file and runs the function(s) or application(s)
%
% GENERAL
%
% [] = my_program ()
%
% ABOUT
% -Created: February 13th, 2004
% -Last update: February 2004
% -Revision: 0.0.1
% -Author: R. S. Schestowitz, University of Manchester
% =================================================================
fid = fopen('Settings','r');
% NOTE: will open whichever settings file is needed, e.g. Settings1, Settings2, etc.
run_niced = fgets(fid);
display_splash_screen = fgets(fid);
% get settings from the file
if (str2num(display_splash_screen(1)) == 1),
splash_handle = SPLASH_FUNCTION;
% display splash screen
if (strcmp(getenv('OS'), 'Linux'))
if (str2num(run_niced(1)) == 1),
% run with CPU at lower capacity
unix('nice MY_FUNCTION');
% Run the main function
else
MY_FUNCTION;
end
else
% if not running on Linux
MY_FUNCTION;
end
close(splash_handle);
% close the splash screen once the main window/program is running
clc;
else
MY_FUNCTION;
clc;
% clear screen when the main window is open or when program is running
end
generate_documentation = fgets(fid);
if (str2num(generate_documentation(1)) == 1),
DOCUMENTATION_FUNCTION;
% document the package if settings force it to be enabled
end
|
|
Contact us at files@mathworks.com