ctdcal - AOML PhOD CTDO2 calibration toolbox ctdcal is both a function and a directory This function (ctdcal/ctdcal.m) is the main control/startup file for the ctdcal toolbox. It also acts as a reference source for information on the toolbox version, installation directory and other metadata that may be necessary from the Matlab prompt. The ctdcal.m file is within the ctdcal directory, which must appear somewhere on the MATLABPATH. The most logical place is in the user's matlab directory on linux and in the local toolbox directory on a Windows PC. The following line must then be added to the user's startup.m file or appended to the path in some other way. % Add ctdcal directory to the path on Derrick's linux computer path(fullfile('home','snowden','matlab','ctdcal'),path) % prepend ctdcal The line above adds the directory /home/snowden/matlab/ctdcal/ to the beginning of my matlab path. See the User's Guide for more information on installation and path management. USAGE: >> ctdcal % Displays installation_directory and version on the command line >> [opts] = ctdcal % Returns a structure with fields 'path' and 'version' >> ctdcal('version') % Displays the version on the commandline >> ver = ctdcal('version') % Returns the version as a double scalar array >> ctdcal('path') % Displays the installation path on the command line. >> pth = ctdcal('path') % Returns the installation path in a char array. AUTHOR: Derrick Snowden and Carlos Fonseca NOAA/AOML/PhOD Thu Sep 16 13:47:28 EDT 2004 SEE ALSO: contents.m, version.m, ctdcal/doc/howto/ctdcal.html - User's Guide ctdcal/doc/ctdcal/ctdcal.html - Matlab function documentation in html format http://doris/matlab/ctdcal on the AOML intranet. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001 function [varargout] = ctdcal(varargin) 0002 % ctdcal - AOML PhOD CTDO2 calibration toolbox 0003 % ctdcal is both a function and a directory 0004 % 0005 % This function (ctdcal/ctdcal.m) is the main control/startup 0006 % file for the ctdcal toolbox. It also acts as a reference 0007 % source for information on the toolbox version, installation directory 0008 % and other metadata that may be necessary from the Matlab prompt. 0009 % 0010 % The ctdcal.m file is within the ctdcal directory, which must appear 0011 % somewhere on the MATLABPATH. The most logical place is in the 0012 % user's matlab directory on linux and in the local toolbox directory 0013 % on a Windows PC. The following line must then be added to the user's 0014 % startup.m file or appended to the path in some other way. 0015 % 0016 % % Add ctdcal directory to the path on Derrick's linux computer 0017 % path(fullfile('home','snowden','matlab','ctdcal'),path) % prepend ctdcal 0018 % 0019 % The line above adds the directory /home/snowden/matlab/ctdcal/ to 0020 % the beginning of my matlab path. 0021 % 0022 % See the User's Guide for more information on installation and path management. 0023 % 0024 % USAGE: 0025 % >> ctdcal % Displays installation_directory and version on the command line 0026 % >> [opts] = ctdcal % Returns a structure with fields 'path' and 'version' 0027 % >> ctdcal('version') % Displays the version on the commandline 0028 % >> ver = ctdcal('version') % Returns the version as a double scalar array 0029 % >> ctdcal('path') % Displays the installation path on the command line. 0030 % >> pth = ctdcal('path') % Returns the installation path in a char array. 0031 % 0032 % AUTHOR: 0033 % Derrick Snowden and Carlos Fonseca 0034 % NOAA/AOML/PhOD 0035 % Thu Sep 16 13:47:28 EDT 2004 0036 % 0037 % SEE ALSO: contents.m, version.m, 0038 % ctdcal/doc/howto/ctdcal.html - User's Guide 0039 % ctdcal/doc/ctdcal/ctdcal.html - Matlab function documentation in html format 0040 % http://doris/matlab/ctdcal on the AOML intranet. 0041 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0042 0043 % TODO: % Change hard coded version number this when the revision control system is implemented. 0044 VERSION = 1.0; 0045 [theFilePath,b,c,d] = fileparts(which(mfilename)); 0046 0047 if nargin==0 0048 if nargout == 0 0049 disp('CTDCAL Toolbox') 0050 disp(['Version: ' num2str(VERSION)]) 0051 disp(['Installation directory: ']) 0052 disp(theFilePath) 0053 disp(' ') 0054 return 0055 elseif nargout==1 0056 varargout{1} = struct('version',VERSION,'path',theFilePath); 0057 return 0058 end 0059 end 0060 0061 % One output argument, see what the user wants. 0062 if nargin == 1 0063 if ~ischar(varargin{1}) 0064 error('input variable must be a character array.') 0065 end 0066 theArg = varargin{1}; 0067 switch lower(theArg(1:3)) 0068 case 'ver' 0069 % version 0070 if nargout==0 0071 disp(['CTDCAL Toolbox Version: ' num2str(VERSION)]) 0072 return 0073 else 0074 varargout{1} = VERSION; 0075 return 0076 end 0077 0078 case 'pat' 0079 % installation path of ctdcal/ 0080 if nargout==0 0081 disp(['CTDCAL Toolbox Path: ' theFilePath]) 0082 return 0083 else 0084 varargout{1} = theFilePath; 0085 return 0086 end 0087 otherwise 0088 error('Invalid input switch.') 0089 end % End switch/case/end 0090 end % if nargin == 1 0091 return 0092 0093 0094